WordPress.org

Ready to get started?Download WordPress

Forums

Vantage
Active Menu (8 posts)

  1. luxman89
    Member
    Posted 8 months ago #

    Hi,
    How do i can make the menu to active state, when it is selected.

    Thanks in advance.
    V.Lakshman

  2. Thimothe
    Member
    Posted 8 months ago #

    Hi,

    can you post a link to your site please? It will make be easier to assist you.

    Thanks

  3. luxman89
    Member
    Posted 8 months ago #

    Link

    Thanks for you reply Thimothe

  4. Thimothe
    Member
    Posted 8 months ago #

    so you'll need to apply some custom css to make it work. Look for an option in your theme options and if you can't find one, you can proceed with a Customm css plugin or creating a child theme.

    In the custom css, you'll want to style according to this example

    // Styling for the parent menu item
    .main-navigation ul li.current-menu-parent {
    background-color:green; //just an ugly example
    }
    
    // Styling for the current page
    .main-navigation ul ul li.current-menu-item {
    background-color:red; //just an ugly example
    }

    And if you want both the parent and the current menu item to have the same styling, you can combine both declarations together like this

    .main-navigation ul li.current-menu-parent, .main-navigation ul ul li.current-menu-item {
    background-color:yellow; //just an ugly example
    }

    I hope this helps

  5. luxman89
    Member
    Posted 8 months ago #

    I have tried your code, but its not working . could you please elobrate more.

    Thanks for your effort...
    V.Lakshman

  6. Greg Priday
    Member
    Theme Author

    Posted 8 months ago #

    Thimothe's code is nearly spot on. You just need to target the A tag instead.

    .main-navigation ul li.current-menu-parent a, .main-navigation ul ul li.current-menu-item a {
    background-color:yellow; //just an ugly example
    }

    If that still doesn't work, you could try adding an !important to the background colour.

  7. luxman89
    Member
    Posted 8 months ago #

    sorry guys, i have tried that it dosent worked for me...

  8. Thimothe
    Member
    Posted 8 months ago #

    Where did you paste the code?

    Can you see the code being displayed on your site through Chrome Dev Tools or Firebug? It is possible that you have a cached copy (either through CDN , cache plugin or browser cache) which prevents the change from displaying in your browser.

Reply

You must log in to post.

About this Theme

About this Topic