I’m using WP_User_Query to get a list of users from my database. I’m showing specific users only via use of the include parameter. For example: $args = array( 'include'...
So in the template I’ve multiple featured posts and sliders and 2 default loops. I use get_posts for everything except default loops (obviously). Now the issue I’m having is...
I’ve used WP_Query to query and display events. In some cases, though, there are no events to be displayed and I’d like to display a friendly message when that...
I am trying to customize the search results for a generic search, but only if it’s using the search.php template. I have other searches on my site, and I...
I am on a shared hosting which has a limitation at MySQL queries per hour. My shows unable to connect to database because of this. Can anyone tell me...
I have this code to remove orphaned posts after deleting custom post type. It works, but this code… global $wpdb; $wpdb->query( $wpdb->prepare( "DELETE a,b,c FROM wp_posts a LEFT JOIN...
I am building a WP site with an events feature. The events page was made with custom post types. I want to make it possible for people to search/...
(Moderator’s note: Title was originally: “query/database optimisation”) I’m written a function for a custom “filter” search panel that allows users to select terms from up to four custom taxonomies....
I’m using WP_User_Query to bring back a list of users. According to this article, I can focus the query on particular columns (I’m assuming in the wp_users table) using...
I’m trying to fetch all my WooCommerce orders where some additional metadata is equal to not empty. $orders = wc_get_orders( array( 'orderby' => 'date', 'order' => 'DESC', 'meta_query' =>...