Main menu color

  • Author
    Posts
  • #151720
    sisdcarolo
    Member

    Hello,

    I would like to change the background color of a category in the main menu when I am on a specific page. But this page is not linked to the menu.
    It’s possible?

    Thank you,
    Florence

    The blog I need help with is: (visible only to logged in users)

    #151736
    tarasdashkevych
    Theme Author

    Hi Florence,

    By default, WordPress creates unique ids for the menu items. We can use these ids to create custom styles. Since your site is not public, I am not able to see the id of that category link located in your menu.

    Alternately, you can add a custom CSS class any menu item (see the Customizer approach): https://themesharbor.com/adding-a-custom-class-to-a-wordpress-menu-link/

    Hope this helps. Let me know if you have any additional questions.

    Thank you,
    Taras

    #152504
    sisdcarolo
    Member
    Original poster

    Hi Taras,

    My site is public now : https://sisdcarolo.wordpress.com/
    I would like that when I’m on this page “Nos missions : https://sisdcarolo.wordpress.com/2020/02/13/qui-sommes-nous-3/”, the category “Qui sommes-nous” on the menu to be underlined in a different colour.
    Is that possible?

    Thank you,
    Florence

    #152524
    tarasdashkevych
    Theme Author

    Hello Florence,
    Thank you for the link.

    The site is still in a private mode (https://wordpress.com/support/settings/privacy-settings/), so I cannot inspect it :(

    Kind regards,
    Taras

    #152553
    sisdcarolo
    Member
    Original poster

    Hello Taras,

    I’m sorry, is it okay like this now?

    Thank you,
    Florence

    #152588
    tarasdashkevych
    Theme Author

    Florence,
    Thank you for making your site public.

    Please use this custom CSS:

    
    .postid-460 .menu-item-483 {
      background: #9bd2cb;
    }
    

    460 is the ID of your page (https://wordpress.com/support/pages/#how-to-find-the-page-id).

    By the way, I really like the colors and the font on your site. Well done!

    Let me know if you have any additional questions.

    Thank you,
    Taras

    #152634
    sisdcarolo
    Member
    Original poster

    Hi Taras,

    Perfect! Thank you for the help you give me every time! :)

    Oh thank you !

    Have a nice day,
    Florence

    #152648
    tarasdashkevych
    Theme Author

    Florence,

    You are very welcome! :)

    All the best,
    Taras

  • The topic ‘Main menu color’ is closed to new replies.