Code to generate current-cat-parent? (2 posts)

  1. xiabolai
    Posted 6 years ago #


    I've searched and can't find the answer for my situation.

    I have a category dropdown menu item, but cannot seem to get the code to generate "current-cat-parent" for the parent menu item when a submenu item is clicked.

    I want to do this so I can highlight the parent menu item when a submenu child is clicked.

    Here's my code:

    <li class="cat-item">
    <a href="#">Work</a>
    <ul class="children">
    <?php wp_list_categories("exclude=$blog_ID&title_li=");('orderby=name&title_li=');
    $this_category = get_category($cat);
    if (get_category_children($this_category->cat_ID) != "") {
    echo "<ul>";
    echo "</ul>";

    I think I have the right css, but because the "current-cat-parent" code isn't being generated when I click on a subcategory, the css can't style the parent menu item.

    Any help would be greatly appreciated!

  2. DennisvanHouts
    Posted 6 years ago #

    I have the same problem, any solutions?

Topic Closed

This topic has been closed to new replies.

About this Topic