• The code below works great, except I can’t seem to properly exclude any category.

    Where it says “‘category__in’ => array($category->term_id),” I have tried replacing the contents inside the parenthesis with term id numbers, like ‘3’, ‘5’ but that doesn’t seem to work. Any ideas on what I’m doing wrong here?

    Thanks in advance!

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ensignkid

    (@ensignkid)

    http://wordpress.pastebin.com/brBB69pL

    So, to elaborate, I don’t want to show the Category title for the excluded categories. The excluded category titles continue to appear even if I properly exclude the cat_id in the array by using category__not_in' => array('3','5'),

    For example, if I excluded category 3 and 5 (as shown above), all the titles appear, but only the posts from category 1, 2, 4 appear under all of those titles. It’s like the function is broken when excluding categories at this level.

    Thread Starter ensignkid

    (@ensignkid)

    Nevermind, I figured it out.

    To exclude categories, you need add 'exclude' => '3' under ' 'order' => 'ASC', where 3 is the category id.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude categories when using array to show 3 posts from each category’ is closed to new replies.