Why is main query broken in tag template?
-
Hello there!
I’m struggling with a template that, for some reason that I don’t know, it’s not getting any posts in it. I mean, I have a website with a lot of tags, in that site I have a tag.php file for the tag template. So far so good. But when i try to query the posts by doing the traditional if(have_posts()) while(have_posts()) the_post() … I don’d get any posts. It’s the same for every tag, even when they have more than 1000 posts assigned to them.
When i print the global variable $wp_query I can see the object, but the post_count attribute says it doesn’t have any posts ([post_count] => 0)
I’m not messing with pre_get_posts in functions at all, so i think it may be something else.
Anyone has a clue about what may be happening or how can I troubleshot this issue?
FYI
This is happening in a custom theme.
- The topic ‘Why is main query broken in tag template?’ is closed to new replies.