[wp-hackers] Odd query_posts behaviour. Bug or feature?

Bjorn Wijers burobjorn at gmail.com
Sat Dec 5 19:08:01 UTC 2009


Hi,

Just checking if this is intended or a bug (which I will file if no
ticket has been created yet).

Context info:
I use Wordpress Mu 2.8.4a, but I presume this is the same for Wordpress
and I use the Page Tagger plugin which allows one to add tags to Pages
in AFAIK exact the same way as one would add tags to posts. Nothing fancy.

Now I want to query either the published pages with the tag test or the
posts published posts with tag 'test'. This is what I use to query only
posts with the tag I'm interested in:

[code]

  // setup query params
  $q_params = array( 'showposts' => 10, 'paged' =>$paged 'tag' =>
                     'testing', post_status => 'publish',
                      post_type => 'post'
                   );

  // perform query
  query_posts($q_params);

[/code]

However I get everything tagged with the tag testing. Both pages and
posts. A quick echo on the wp_query->request shows that my post_type
parameter has been ignored.

Is this intended? If so what would be the right way to  do what I want?

Any help much appreciated!

-- 

met vriendelijke groet,
Bjorn Wijers

* b u r o b j o r n .nl *
digitaal vakmanschap | digital craftsmanship

Concordiastraat 68-126
3551 EM Utrecht
The Netherlands

phone: +31 6 49 74 78 70
http://www.burobjorn.nl


More information about the wp-hackers mailing list