Support » Fixing WordPress » Code to generate current-cat-parent?

  • Hi,

    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!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Code to generate current-cat-parent?’ is closed to new replies.