Support » Fixing WordPress » Displaying category children–but NOT grandchildren

  • I’m having trouble displaying category children WITHOUT grandchildren.

    Here’s the current code I’m fiddling with:

    $portfoliocat = of_get_option('of_portfolio_cat', 'no entry' );
    $categories = get_categories('child_of='.$portfoliocat.'');

    If I add a parameter to the second line, such as…

    $categories = get_categories('child_of='.$portfoliocat.'&exclude=6');

    …then I can get it to exclude one grandchild at a time. But I’d much rather just have it exclude them all so I don’t have to mess with the code each time a new child or grandchild is created.

    Is this possible?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Displaying category children–but NOT grandchildren’ is closed to new replies.