Support » Plugins » Children of Current Category

  • I’m wanting to edit the category.php page to show the children of the current category.

    For instance, Domestic > Fruit > Apple, Orange, Pineapple

    When you are on the Fruit category page, I’d like for it to just list the subcategories of it.

    Here’s the code from the codex, but from what I see you have to specify what category to show the children from.

    <?php wp_list_categories('orderby=id&show_count=1
    &use_desc_for_title=0&child_of=8'); ?>

    Is this possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok, the only way that I’ve been able to see to do this is to create a custome category-x.php for each category, and manually add in an image and link to the children that exist for x category. The only problem is that there are going to be a few hundred.

    Is that reasonable to do? The headache would come if there should ever be an addition that would effect every one of these categories.

    Maybe one last possible solution that might work.

    How would I do something like, if category has children and has no posts, list the children, but if category has no children and has posts, show posts?

    Basically, the posts will only be made on the deepest sub categories that are available.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Children of Current Category’ is closed to new replies.