[Resolved] Aloha! Apply 'Text Current' color to Nav on page?

Home Forums Support [Resolved] Aloha! Apply 'Text Current' color to Nav on page?

Home Forums Support Aloha! Apply 'Text Current' color to Nav on page?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #334201
    William

    Aloha!

    I have a item in my Primary Navigation called ‘Faculty’.

    When clicked, it:

    1) takes users to a page showing multiple Faculty members (beautiful).

    2) lights the menu item (Faculty) up in a color of my choosing (wonderful) – ‘Text Current’

    Question is …

    When a user clicks a Faculty member photo on said page above, users:

    1) go to a page for a the individual faculty member (great).

    2) the menu item looses its ‘Text Current’ color (bummer).

    Any way to apply ‘Text Current’ on an as needed basis?

    Mahalo for any insights that can be offered,

    Bill

    #334204
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure if this is possible as WordPress needs to see some sort of relationship between the current page and the menu item.

    This topic has similar request and Tom explains it: https://generatepress.com/forums/topic/background-colours-of-menus/

    #334206
    Leo
    Staff
    Customer Support

    Actually I might have a way. Can you provide a link to your site?

    #334207
    William

    Password Protected during development .. Is there a way to share privately?

    Much thanks

    bill

    #334209
    Leo
    Staff
    Customer Support

    Is Faculty a top level menu item?

    #334213
    William

    Yes – it absolutely is.

    The 12 individual faculty members page are not ‘child’ of Parent (Faculty) – but can be if needed.

    #334215
    Leo
    Staff
    Customer Support

    Ok try this:
    – Add no-sub to the custom classes field of Faculty menu item:
    https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes

    – Add the 12 individual faculty members page as child items

    – Add this CSS:

    .no-sub .sub-menu {
        display: none !important;
    }
    .menu-item-has-children .dropdown-menu-toggle {
        display: none;
    }
    .main-navigation .main-nav ul li.menu-item-has-children > a {
        padding-right: 20px;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    – Adjust the px number above to the same as the menu item width:
    https://docs.generatepress.com/article/menu-item-height-width/

    #334232
    William

    You, my friend, are an outstanding human being!!

    Million thanks!

    Hey everybody … it worked 🙂

    My only hiccup was:

    “Add the 12 individual faculty members page as child items” means add them as sub-menu items in the WP nav builder.

    I was giving the sub pages a ‘Parent’ in the page editor (duh) … until I actually looked at Leo’s CSS.

    Huge Mahalo!

    Bill

    #334272
    Leo
    Staff
    Customer Support

    You’re welcome!

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.