• 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_template function 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() and is_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

    https://ww.wp.xz.cn/plugins/add-tags-and-category-to-page/

The topic ‘filtering the wrong query’ is closed to new replies.