Site logo

Archived topic

sf menu item state - odd behaviour

4 replies · Started by Daniel Walker on August 11, 2015

Viewing posts 1–5 of 5

Hi Tom, I'm seeing some odd behaviour with a menu item state on my primary navigation menu.

On the menu I have a few Pages, a couple of category archive links (for custom post types), a bbpress link and a link to my blog index (the page that shows the latest Posts, as defined in Settings > Read).

When I select any Pages, the menu hover/active/visited states all work perfectly, as shown below.
Page selected

However, when I select a category archive or the bbpress index page (set as a 'category' in bbpress), the blog index page menu item also switches to the active state, as shown below.
Category archive page
bbpress index

Any ideas as to what could be causing that?

Thanks,
Dan

Sorry, I mucked up the link to that first screenshot.
Page selected

WordPress gets confused when it comes to custom post types, and thinks you're viewing the blog - so it highlights the blog menu item as well.

The best way I've found to avoid this is to add the link to the Blog or custom post type as a "Custom Link" in "Appearance > Menus" instead of adding it from the "Pages" module (or any of the other modules).

Can you give that a try and let me know if it works or not?

Yep, that's fixed it. Excellent. Thanks Tom.

Dan

Awesome - no problem :)

This archived topic is closed to new replies.