WordPress.org

Ready to get started?Download WordPress

Forums

Advanced AJAX Page Loader
current menu item and current page item (2 posts)

  1. polyfade
    Member
    Posted 8 months ago #

    When navigating to a new Page, the current_menu_item class is not being removed from the former Page's menu item. Instead, all visited Pages bear the class of current_menu_item.
    Even though, by default, the included Click Code is written as:
    jQuery('ul.menu li').each(function() {
    jQuery(this).removeClass('current-menu-item');
    });
    jQuery(thiss).parents('li').addClass('current-menu-item');

    http://wordpress.org/plugins/advanced-ajax-page-loader/

  2. Tim Bare
    Member
    Posted 7 months ago #

    I know it was about 4 weeks ago, but I had to modify it to:

    // highlight the current menu item
    jQuery('ul.menu li').each(function() {
    	jQuery(this).removeClass('current-menu-item');
            jQuery(this).removeClass('current_page_item');
    });
    jQuery(thiss).parents('li').addClass('current_page_item');
    jQuery(thiss).parents('li').addClass('current-menu-item');

    (adding the "current_page_item" in there also)

Reply

You must log in to post.

About this Plugin

About this Topic