I am trying to perform a query on a custom-type post using the value of a custom field. This field contains a string date: dd.mm.yyyy. The post type name...
Right now I am using this: $args_search = array( 's' => $search, 'post_type' => array( 'post' ) ); $wp_query = new WP_Query( $args_search ); But the problem is that...
I want to query by 1 meta key, but sort by another key that may or may not exist, and then by post date So the end result would...
When a user creates/updates a post within the admin, it takes between 15 and 30 seconds for that operation to complete. The culprit appears to be this slow query:...
What is the most efficient way to determine which loop I’m in? I have a few plugins that alter the query by hooking into various parts of WP_Query::get_posts(), through...
I am using the below code in functions.php to add custom query variables to my WordPress project. <?php function add_custom_query_var( $vars ){ $vars = "brand"; return $vars; } add_filter(...
I have a working query that calls all my posts that have a certain meta value for one of two meta keys: $term = filter_var( $_GET['term'] ); $query =...
Okay, so I’m making the blog page for my WordPress site. My front page is displayed as static, so my blog posts are on another page called “Journal.” I...
Seems like half the tutorials in the Codex use wp_reset_postdata() and half use wp_reset_query(). What’s the deal? Maybe Use both of them? What about rewind_posts()? I am asking for...
What’s the best way to alter the query being run on the Posts Edit screen (edit.php)? The current method I’m using is by passing an argument to the global...