Forums

Unable to highlight current category from the menu bar. (2 posts)

  1. jjm0109
    Member
    Posted 1 year ago #

    Hey guys,
    I have a custom menu bar containing pages as well as categories over here: hxxp://www.center forinn ersciences.org/new/ (hTTP, remove spaces)

    I am able to highlight the current page using a .current_page_item class in CSS. But have been working since 2 hours on making category links to do the same.
    I tried .current_menu_item, .current-cat, and many more mods suggested here on related threads but still no results.

    I need the category to get highlighted on the "All Posts Under This Category" page as well as Single posts.

    Any solutions please?

    Thanks a lot.

    Jugal

  2. Try this; change the 1109 to the actual number of the menu item from page source

    <script type="text/javascript">
    jQuery(function($) {
    $(document).ready(function() {
    $('#menu-main-menu li.menu-item-1109').addClass('current-menu-parent');
    }); });
    </script>

Topic Closed

This topic has been closed to new replies.

About this Topic