Tag Info

Hot answers tagged

2

Try to change: <?php if ( have_posts() ) To <?php if ( $verhuurd_query->have_posts() )


1

You cannot sort inside a meta_query. The sorting parameters are invalid inside the meta_query. You will need to move the sorting parameters to outside the meta_query and remember to set the meta_key which will be used for sorting References: WP_Query Custom Field Parameters WP_Query Order and Orderby Parameters


1

The correct query is: $args1 = array( 'showposts' => 5, 'ignore_sticky_posts' => 1, //ORDER ARGUMENTS 'meta_key' => 'post_views_count', 'orderby' => 'meta_key_num', 'order' => 'DESC', //META QUERY 'meta_query' => array( array( 'key' ...


1

Got help on Facebook and just needed to change this: <option value="<?php echo $term->name; ?>" <?php if($_POST['mealtype'] == $term->name) { echo 'selected'; } ?>><?php echo $term->name; ?></option> to this: <option value="<?php echo $term->slug; ?>" <?php if($_POST['mealtype'] == $term->slug) { ...


1

Your problem is your naming convention. Look at the Template Hierarchy. The archive- prefix is reserved for date and custom post type archive pages. You are using this as prefix to a page template This is not only confusing to humans, but to Wordpress as well. For page templates you should be using the page- prefix. Just a note, as from version 3.4 you ...


1

You cannot mix array syntax and string syntax in the same argument. If you start with array syntax, you should stick with that, the same applies if you start with string syntax, then you should stick with string syntax. Because you are using post__not_in which is an array, you should stick with array syntax <?php $query = new WP_Query( array( ...


1

You're not using query_vars quite right - this filter is for whitelisting "public" query vars, not actually setting their values. It's also called rather early (wp::parse_request), so any conditional tags like is_tax() will always be false at this stage. Use the pre_get_posts action for overriding the default query. Having said that, you need a custom ORDER ...


1

As already pointed out in comments gb_bypass_filter is not a valid parameter for WP_Query. If you want to suppress to effect of filters on your query, add 'suppress_filters' => true to your query arguments previous_posts_link() does not accept two arguments, only one. Unlike next_posts_link(), it does not have the second $max_pages parameter. So you can ...


1

The function have_posts is for the main loop, so the if statement is checking the main loop, which will probably always have posts. You want to use the custom query's have_posts for the if statement instead. if ( $verhuurd_query->have_posts() ) : while ( $verhuurd_query->have_posts() ) : $verhuurd_query->the_post(); ?>



Only top voted, non community-wiki answers of a minimum length are eligible