• Resolved David Gard

    (@duck_boy)


    Hey all,

    For some reason when I use query_posts the wrong posts are being displayed when I am filtering by a custom taxonomy, called ‘contact’, and i cannot figure out why. Rather than the list of Posts with the contact a Post that has the same name as the contact is being displayed.

    I am using this code –

    $args = Array( // Array of arguments for query_posts()
    	'cat' => $cat,
    	'posts_per_page' => 10,
    	'paged' => $paged,
    	'tag' => get_query_var('tag'),
    	'tla_tag' => get_query_var('tla_tag'),
    	'contact' => get_query_var('contact'));
    query_posts($args);

    Yet the arguments are collecting the correct data –
    Array ( [cat] => 75 [posts_per_page] => 10 [paged] => 0 [tag] => [tla_tag] => [contact] => john-smith )

    Any help would be appriciated.

    Thanks.

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter David Gard

    (@duck_boy)

    Tested and successful. The magic line wp_reset_query(); at the end of that block has solved the problem.

    Thanks.

    MichaelH, you pointed to ticket 9951. That’s still slated as “future release”. Any news on when that fix may ship?

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘query_posts displaying the wrong posts’ is closed to new replies.