filtering the wrong query
-
Hi Dinesh –
The form on your site is not accepting my post (probably too many function names π ), so it’s going here.
The
tcp_add_post_types_in_category_and_tag_templatefunction has a series of checks for category and tag, but they are checking the page’s main query rather than the one that was passed. This is breaking sub-queries on category and tag pages.To fix this, replace
is_category()with$query->is_category()andis_tag()with$query->is_tag()Looks like lots of people are running into issues caused by this bug. Restricting the filter to the main query as some have suggested will help but also limit functionality. I believe the steps above provide a complete fix.
– David
The topic ‘filtering the wrong query’ is closed to new replies.