Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
You need to wrap your code in a loop. Instead of if ( $query->have_posts() ) {, use: while ( $query->have_posts() ) { $query->the_post(); // Rest of code } wp_reset_postdata();
You need to wrap your code in a loop. Instead of if ( $query->have_posts() ) {, use: while ( $query->have_posts() ) { $query->the_post(); // Rest of code } wp_reset_postdata();
This is what works in my query: <?php $argsfeature = array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’, ‘order’ => ‘DESC’, ‘posts_per_page’ => ‘1’, ‘meta_key’ => ‘featuring’, ‘meta_value’ => ‘1’ ); ?> and this query works: <?php $argsarticles = array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’, ‘order’ => ‘DESC’, ‘posts_per_page’ => ‘5’, ‘post_parent__in’ => array(10,11) ); … Read more
Why does order ASC break offset in WP_Query?
Complicated WP_Query
Problem with WordPress 4.0 and $wp_query
If you think that you are making too many DB requests then you need to reorganize the way you store your data to be more efficient. It might even be totally irelevant if you employ the right type of caching. If your visitors are usually not logged in then a full page caching that W3TC, … Read more
WordPress WP_Query Array Custom search via taxonomies
Well, in case anyone is searching and trying to find a way to do what I did here, I figured it out myself. My task was: I have a custom post type called vehicle and there are two taxonomies, the vehicle maker and the vehicle model. I needed to show all the posts alphabetically ordered … Read more
The problem was that the nc_hidden met property did not exist if it was not checked so there was essentially no value to query against. I swapped nc_hidden from a checkbox to a select and updated my query as required. The working query is now as follows: $query_args = array( ‘posts_per_page’ => ‘1’, ‘orderby’ => … Read more
WP_Query on “property” in the options table