Request re Subcategory menu (7 posts)

  1. mookie
    Posted 12 years ago #

    I don't know if this is planned or not.... but 'd love to see a category menu that only showed the 1st parent level on index.php and then only showed the children in that category if you clicked and went to that category.
    This would help keep the menu to a manageable size when using subcats.

  2. elfin

    Posted 12 years ago #

    This is something I would like as well, maybe the use of the category ID and relationships to parent categories would be a starting point.

  3. junesix
    Posted 12 years ago #

    You may want to check out using collapsible category lists.

  4. elfin

    Posted 12 years ago #

    Problem is..I am looking for a non-javascript solution. It should be possible in css. But see my entry in the other thread.

  5. junesix
    Posted 12 years ago #

    OK, I understand what you're looking for. What you could do is create a new template just for your categories. Then in your index.php, when you call the category list, use <?php wp_list_cats('children=FALSE'); ?> . This will hide the child categories from your front page. Then in the category archive template, you'd use the <?php wp_list_cats('child_of=X'); ?> where X is the category ID of the category you're viewing. This should show only the child categories for the category ID specified. Unfortunately, I haven't figured out how to dynamically pass the category ID. Keep an eye on the solutions in this thread and your answer to the last part should be solved.

  6. elfin

    Posted 12 years ago #

    hmmm, tried some of that and it didn't work, soooo I am developing a new idea and have just posted to ask for some help with a script Testing and obtaining category_parent ID
    So far I have been able to hide the children(sub-category) where not required, except when you click on one of the sub-categories...

  7. elfin

    Posted 12 years ago #

    I've created the script, and have started a new thread :
    Expanding sub category menu via css

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.