Support » Themes and Templates » Highlight ''Current Page'' in Nav Bar Menu

  • Hello Y’all!
    I’m no web design Jedi yet, so I would really need your help!

    Here’s the website I’m developing —-> LINK

    I would like to get some help to setup the menu to highlight the button of the ”current page”while visiting the page…
    this way the user knows exactly in which page he’s/she’s in …

    I’m using WP 4.2.3, Modifing a Child Theme of Orginal Theme MedicalPlus of Moopress,

    I tried many links/threads overs days..
    but can’t seems to find the right answer yet…
    And my boss is really wants this new feature…

    Thanks for your Help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hey there MoreCoko,

    How are you doing today?

    I’ve checked your site and this is definitely possible with some custom CSS.

    Current menu items has class “active” which you can use to apply styles to that menu item only. So depending on what you’re looking to do this should be the selector you’re aiming for:

    li.active.nav-main-item {
        }

    Or this one if you’re trying to modify the link of the current menu item instead:

    li.active.nav-main-item a {
        }

    If you need more help with this one please let me know (embrace the dark side for more CSS power) 🙂

    Cheers,
    Bojan

    Hey Bojan !!!
    I’m great thanks for asking! How about you?
    Thanks for Your Reply! I really appreciate!

    Great News so I don’t need to create class/body Tag for each page…!?! .. Ouf!! 🙂

    I don’t want to modify the link for now, I just want the ”current-page” to be highlighted so users (mainly my boss, lol) don’t get lost Navigading through the website…

    I would gladly accept so more pointers from you if your willing to guide me towards towards getting empowered by the dark force of CSS! 🙂

    Thanks again,
    Chris

    Hey Chris,

    Sure thing!

    Just let me know what exactly do you have in mind and I’ll try to help.

    For example if you want to have same border on active menu item as you have when you hover on one you can try adding something like this:

    li.active.nav-main-item span {
        border-bottom: 2px solid #d33;
    }

    This should add the same underline on active item as you have when hover on one.

    Hope this helps 🙂

    Cheers,
    Bojan

    Hey Bojan!
    Love the Pic!!! 😛
    Thank you for your help!

    I’ve added your code lines to my Child stylesheet (style.CSS)…
    It Should overwrite Parent Theme CSS right?
    And since all my classes are already there I don’t need to play in the Theme Functions right?

    Sorry for All those Newbie Questions, I just want to make this right

    So far i don’t see any changes but I think it’s normal since all the changes that I made to the Css prior to this one took some time to apply…

    This should add the same underline on active item as you have when hover on one

    That’s exactly what I had in mind…!
    So I’ll wait few hours to see if the CSS changes apply and I’ll keep you posted!

    Thanks Again for your Support

    Ps… Sorry for the Meme Blast in this thread, I just had to much fun to stop! 😛

    Hey again,

    Yours are even better, didn’t have this much fun working in threads in a while 🙂

    And since all my classes are already there I don’t need to play in the Theme Functions right?

    Definitely not, child theme style.css should be loaded after your parent theme one so you have nothing to worry about. Of course code can be overridden with specificity or by use of important declaration but that shouldn’t be the case here.

    So far i don’t see any changes but I think it’s normal since all the changes that I made to the Css prior to this one took some time to apply..

    I’ve checked the site again and I can’t see the code added there. This is normal if you have any sort of caching on your site (plugins or maybe server sided caching) or it can mean something in the code is not good. If using caching plugins you can try deactivating it or clearing the cache and if on server you’ll have to wait or contact your hosting provider.

    Either way let me know in case you don’t see any changes so I can take a look 🙂

    Have a great day and thanks for the memes!

    Cheers,
    Bojan

    Hello Again Bojan!
    Me too I’m having a blast in this thread! Resolving issues never been so pleasant!

    This Thread is definitively more exciting then dealing with my boss , all his questions, issues & Demands… 😛

    I’ve checked the site again and I can’t see the code added there. This is normal if you have any sort of caching on your site (plugins or maybe server sided caching) or it can mean something in the code is not good. If using caching plugins you can try deactivating it or clearing the cache and if on server you’ll have to wait or contact your hosting provider.
    Either way let me know in case you don’t see any changes so I can take a look 🙂

    Indeed, I have W3 Total Cache Plugin,

    I tried to first to clear the cache (what I always do after any updates),still no changes…

    Also Desactivate it and then re-save/update the stylesheet (style.css) in my child editor…. Still no changes…

    So I’m starting to wonder, how long should it take normally…?

    Should I try something else?

    Maybe trying to add it that code directly in my ftp files manager???
    Maybe Changing the code?

    What’s your suggestion?

    Thanks Again Bojan!!

    Hey again MoreCoko,

    There should be an option to clear cache within W3 Total Cache, and if the code is not applied till now I don’t believe this is related to server sided caching.

    Since you’re adding the code to your child theme style.css I’m assuming there is something wrong there, would you mind installing http://wordpress.org/plugins/simple-custom-css plugin.

    Once the plugin is installed and activated you can add the above code to Appearance -> Custom CSS. Please make sure to add only this:

    li.active.nav-main-item span {
        border-bottom: 2px solid #d33;
    }

    This will help us to know if the problem is in your child theme style.css.

    Also if there is no caching on your site changes should appear as soon as you refresh the page, I’m starting to wonder if I’m helping here at all.

    Also that code not working meme is hilarious 😀

    Cheers,
    Bojan

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Highlight ''Current Page'' in Nav Bar Menu’ is closed to new replies.