I noticed that when I have the tag__in argument, the post_type one is ignored. Has anyone noticed this or knows a fix?

`$args = array(
            'post_type' => 'page',
            'posts_per_page' => 16,
            'tag__in' => array(10, 11, 13, 15),
            'post_status' => 'any',
            'orderby' => 'ID',
            'order' => 'DESC'


  • It is not clear what do you mean in "ignored" here – Mark Kaplun Jul 19 '17 at 11:58

This is not a bug that I have heard of so I would make sure you do not have a plugin or some other code filtering pre_get_posts.

I would recommend checking the SQL that is run to try and debug.

$query = new WP_Query($args);
echo '<pre>'; var_dump($query->request); echo '</pre>';

Using that you can verify if the WHERE clause includes the post_type for 'page' or 'any'.

| improve this answer | |
  • Yes, somehow something overwrites it in where. But it`s only happening on this page. – Iulian Jul 19 '17 at 12:04
  • What page is 'this page'? Have you disabled all your plugins and switched to a twenty something theme? – danbrellis Jul 19 '17 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.