WP_Query search by multiple meta key and distance

You can do that. There are filters available in WP_Query that enable you to modify the query just as you like. The filter posts_clauses filters all of the parts of the query together. There are also filters specific to the parts of the query too. The best way to know about them is, search posts_clauses … Read more

WP_Query breaks pagination

If you want to stay with a new Wp Query, as in your example, changing your $allsearch name for the query variable to $wp_query should do the trick. Looks like the pagination functions are expecting that variable name for the query… So, try that…

How to query custom post then display sections by meta value

I would recommend executing two separate queries, each one differing from the other via a meta_query against your post custom meta key value. $current_query_args = array( ‘post_type’ => ‘recipient’, ‘meta_query’ => array( array( ‘key’ => ‘yes_current’, ‘value’ => ‘on’, ‘compare’ => ‘=’ ) ) ); $current_query = new WP_Query( $current_query_args ); if ( $current_query->have_posts() ) … Read more

issue displaying variations in custom template using WPeC 3.8.9.2

If you look at the default wpsc-products_page.php template, it uses while (wpsc_have_products()) : wpsc_the_product(); instead of have_posts() and the_posts() to setup the loop. The wpsc_the_product() function sets up a global $wpsc_variations object that the product variation functions use. I think in order to use wpsc_the_product() you need your query to be the global $wp_query, but … Read more

Query posts by custom fields

I managed to figure it out (finally) after about 12 hours of screwing around. The answer here gave me 98% of the answer, and the rest was simply using the appropriate hooks to modify it for my use and to include the postmeta table.