Skip to main content

New answers tagged

0 votes

What is the easiest way to create a custom field archive?

To create a custom field archive in WordPress where posts are filtered by a user_submit_name custom field, follow these steps: Register a Query Variable: This enables WordPress to recognize and use ...
mukto90's user avatar
  • 1,479
0 votes

WP Query: orderby with one meta key, but multiple values

Use this code instead- $supplierArgs = array( 'post_type' => 'service_providers', 'meta_query' => array( 'relation' => 'OR', array( 'key' => '...
mukto90's user avatar
  • 1,479
0 votes

Why is my nested 'OR' meta_query not working?

I am experiencing the same issue. Whenever I try to combine AND with nested OR queries, the query returns only posts that match both nested arguments, thus applying AND to the nested arguments instead ...
Jelle Wielsma's user avatar
0 votes

Not displaying the wp_query object for the following code in the frontend

For just print the query object put this in your function.php: add_action('wp_footer', function () { global $wp_query; echo '<pre>'; print_r($wp_query); echo '</pre>'; ...
Pratik Patel's user avatar
  • 1,103
0 votes

WP_Query - Order results by meta value

To address the point raised by @adamj on the accepted answer if the meta_key does not exist for the post yet, the post will be ignored. Here is a solution that will include even posts which are ...
Meyer Auslander - Tst's user avatar

Top 50 recent answers are included