How to exclude a category from author archives. (2 posts)

  1. morgyface
    Posted 3 years ago #

    When clicking on an authors name I want the author archive to exclude all posts with a certain category. Anyone know how this is done?

  2. bcworkz
    Posted 3 years ago #

    You will want to modify the query by hooking the action 'pre_get_posts'. The first example on Plugin API/Action Reference/pre get posts is applicable to your situation except the conditional in your case would be $query->is_author().

Topic Closed

This topic has been closed to new replies.

About this Topic