WordPress.org

Forums

Events Manager
[resolved] Category page lost "current-menu-item" CSS class in nav-menu (4 posts)

  1. panda74
    Member
    Posted 1 year ago #

    I have a category single page in the navigation menu of twenty-thirteen theme. Some CSS rules make an effect for the current menu item.
    When I browse the em-category page, I lost "current-menu-item" class.
    I tried with other "objects" like location, event, etc. They works well with "current-menu-item". So I did a little investigation in the "nav-menu-template.php" located in wp-includes folder.
    The problem seems come from the function "_wp_menu_item_classes_by_context" around line 484 :

    elseif (
    	$menu_item->object_id == $queried_object_id && //<- this line
    	(
    		( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && $wp_query->is_home && $home_page_id == $menu_item->object_id ) ||
    		( 'post_type' == $menu_item->type && $wp_query->is_singular ) ||
    		( 'taxonomy' == $menu_item->type && ( $wp_query->is_category || $wp_query->is_tag || $wp_query->is_tax ) && $queried_object->taxonomy == $menu_item->object )
    	)
    )

    For a location/event, $menu_item->object_id equals $queried_object_id then the function add "current-menu-item". However this is not the case for category. I found that category is the only taxonomy in this plugin, so I don't know whether the problem is related.

    As I don't know what $menu_item->object_id and $queried_object_id stand for, neither how a taxonomy works in the back-end, I'm totally clueless to resolve the problem.

    Any suggestion is welcome !

    http://wordpress.org/plugins/events-manager/

  2. angelo
    NetWebLogic Support
    Posted 1 year ago #

    can you try settings at Events -> Settings -> Pages -> Event Categories
    And set "Override with Formats?" to NO

  3. panda74
    Member
    Posted 1 year ago #

    When I deactivate "override with formats", it shows "You have come to a page that is either not existing or already been removed."

  4. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Have you tried re-saving your permalinks?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic