WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. morgyface
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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