• Resolved Jane

    (@jstepak)


    My site is: http://www.jswebsitedesign.com

    I’m able to get the menu item associated with the current section to highlight nicely when I use the relative anchor in the URL for each custom menu (i.e. “#theChallenge”)

    But since I have a blog section and need to be able to navigate back to the Home page sections from the individual blog posts, I need to use the full URL (i.e. http://www.jswebsitedesign.com/#theChallenge) for each custom menu item.

    The downside is that now all of the menu items appear selected (green).

    Can you help me figure out how to select only the menu item for the current section. (I have “Force single highlight” set in the Page Scroll to ID setup)

    https://wordpress.org/plugins/page-scroll-to-id/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author malihu

    (@malihu)

    Hi,

    I checked your page via dev tools. Your links get the green color because of this css rule:

    #top-menu li.current-menu-ancestor > a, #top-menu li.current-menu-item > a{
        color: #85c441;
    }

    If you remove it, then the highlighting of each link works as it should because of the following rule not being overwritten:

    .menu-item a.mPS2id-highlight, .mPS2id-highlight{ color: #85C441 !important;}

    Thread Starter Jane

    (@jstepak)

    Hi Malihu,

    Thanks for your reply and suggestion. I removed this css rule:

    #top-menu li.current-menu-ancestor > a, #top-menu li.current-menu-item > a{
    color: #85c441;
    }

    all the menu items still appeared as green.

    To do a quick test, I updated the “The CHALLENGE” menu item

    from: http://www.jswebsitedesign.com/#theChallenge
    to: #theChallenge

    and the highlighting for “The CHALLENGE” menu item is working, but when I go to an individual blog page and click “The CHALLENGE”, the link is “http://www.jswebsitedesign.com/clueless/#theChallenge” instead of “http://www.jswebsitedesign.com/#theChallenge” so it doesn’t work.

    If you have any suggestions on what CSS I should define and also how I should define the URLs for these custom menus, I’d appreciate it.

    Thanks in advance for your help with this!

    Plugin Author malihu

    (@malihu)

    Seems that the CSS rule is still active.

    Open your page with Chrome, right-click any green menu link and select ‘Inspect element’. You’ll see that the rule is still active in ‘Style’ tab on the right. You can also see the location of the rule, which seems to be inline in index, line: 62 (inside the head tag).

    Your links href should be in the form of “http://www.jswebsitedesign.com/#theChallenge” (not just “#theChallenge”), in order to work from other pages (e.g. blog).

    Thread Starter Jane

    (@jstepak)

    Hi Malihu,
    Thanks for your latest reply. Now I see what was happening. I removed the CSS rule from the .css file but the selected menu color was defined in the theme customization in the WordPress admin backend. I set it to white there and now the menus are selected as expected.
    Thanks very much for your help with this issue!

    Plugin Author malihu

    (@malihu)

    Glad I helped 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘All menu items highlighted when using absolute links to accommodate off page nav’ is closed to new replies.