WordPress.org

Forums

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

  1. polyfade
    Member
    Posted 1 year 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 1 year 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)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic