WordPress.org

Ready to get started?Download WordPress

Forums

Exclude All Posts in a Category, even if those posts are in other categories (2 posts)

  1. iftomkins
    Member
    Posted 3 years ago #

    I'm having big challenges excluding categories from my feeds, archives, you name it.

    I tried the solution here, to no avail:
    http://wordpress.org/support/topic/wp-31-breaks-rss-customization-via-exclude_category?replies=2

    I think the problem is that the Posts I am trying to Exclude are in multiple categories, so I'm trying exclude category 28, but it's also in 4 other categories, which are not being excluded. I think this because when I remove a Post from all other categories, and have it only be in Category 28, then I can successfully exclude it.

    Does anyone have any suggestions on how to exclude posts in this one category, even if the posts are in other categories, too? Thanks!

  2. iftomkins
    Member
    Posted 3 years ago #

    Ok, after much bungling, this is the query_posts that worked for me! Finally!

    I am excluding category 28, and including category 'brands':

    <?php query_posts( array( 'category__not_in' => array(28), 'category_name' => 'brands', 'posts_per_page' => '12', 'paged' => $paged, 'orderby' => 'title', 'order' => 'ASC' ) );?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags