• Nick

    (@tolputtkeeton)


    Hi all,

    I have a problem in that only one menu item wont show the ‘current-menu-item’ class when I’m on that page.

    Latest version of WordPress, and the theme is a custom theme built as a child theme of 2012 (also upto date). Using

    <?php wp_nav_menu( array(‘menu’ => ‘Nav’, ‘sort_column’ => ‘menu_order’ ) ); ?>

    to call in the menu.

    Other pages included the menu show the current-menu-item class when on that page, but one doesn’t. This one page should be no different to the others. Its a page (rather than a post), it has content, albeit a custom template that pulls in the list of posts (template selected on the page drop down in the WP admin). Permalinks are all fine, no other errors.

    I’ve tried re-adding it to the menu, but still no luck.

    Any ideas on what this is happening? I’ve never encountered this before. The site in question is currently unavailable to the public.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator t-p

    (@t-p)

    Check if this problem occure when you momentarily switch to the default Twenty Twelve theme?

    Thread Starter Nick

    (@tolputtkeeton)

    I’m always wary of doing that, as I always find a multitude of things disappear when I switch it back. Particularly widgets.

    Thread Starter Nick

    (@tolputtkeeton)

    Some other strange problems:

    Not just one page that has this, but 2.

    Another thing, is when on a page that has a custom template to display news/blog posts, the home page menu is activated as the current page, when its not?

    Thread Starter Nick

    (@tolputtkeeton)

    Tried it on a test server, and the 2012 theme seems to work ok with the menu highlights, just not my custom theme.

    Moderator t-p

    (@t-p)

    2012 theme seems to work ok with the menu highlights, just not my custom theme

    This indicates that your custom theme is broken/incompatible

    Thread Starter Nick

    (@tolputtkeeton)

    Yeah, but I’m not sure how. I’m using WP’s menu functions, so in theory it should work right? Why would WP give, for example, the home page menu item the class ‘current-menu-item’ when I’m not on the home page, but a subpage displaying blog posts.

    Similarly, why would it not give a menu item the ‘current-menu-item’ class when I am on that page?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘current-menu-item missing from menu items’ is closed to new replies.