Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1461772

    Dear team,
    I have the following requirement: I have a page where I need a different menu color on two pages.
    All menu colors only with page id 26 and page wide 362 should have color #8b1a1a when the menu is not active as well as menu active. Menu hover already has the red color.
    I hope, I’ve seen the page id correctly…
    I’ve added the following code but it’s not working.

    add_action(‘wp_head’, ‘change_menu_color’);
    function change_menu_color() {
    if (is_page(array(26, 362))) { ?>
    <style>
    color: #8b1a1a !important;
    </style> <?php
    }
    }

    Could you please help me? Thanks :)
    Kind regards, Nina

    #1461784

    Hey Nihru,

    You don’t have a selector in your CSS, you can try this for example:

    nav.main_menu li a {
      color: #8b1a1a
    }

    You could also do it with pure CSS, look for the page ID class in the body tag for each page.

    Best regards,
    Rikard

    #1461906

    Hello Rikard,
    thanks for your answer. Unfortunately your code
    nav.main_menu li a {
    color: #8b1a1a
    }
    is not working.
    Did I miss something? I am not good at programming, sorry. Would you mind giving me the code you mentioned “You could also do it with pure CSS, look for the page ID class in the body tag for each page.” ?
    Thanks! :-)
    Kind regards, Nina

    #1461919

    Hi,

    Please try this in Quick CSS:

    .page-id-26 nav.main_menu li a, .page-id-362 nav.main_menu li a {
      color: #8b1a1a;
    }

    Best regards,
    Rikard

    #1462068

    Hello Rikard,
    thank’s for the code. Unfortunately it’s still not working. Maybe there is a mistake with the page id from my side.
    May I give you the login data so you can have a look at both page id’s?
    Thanks!
    Kind regards,
    Nina

    #1462093

    Hi,

    Please try this instead:

    .page-id-26 nav.main_menu li a, .page-id-362 nav.main_menu li a {
      color: #8b1a1a !important;
    }

    Best regards,
    Rikard

    #1462196

    Hi Rikard,
    thank’s for the code. It’s still not working :-(
    Any other idea?
    Kind regards,
    Nina

    #1462248

    Hi,

    It’s working on my end. If you want it to apply to the transparent header state as well, then please add this:

    .page-id-26 .av_header_transparency nav.main_menu li a, .page-id-362 .av_header_transparency nav.main_menu li a {
      color: #8b1a1a !important;
    }

    Best regards,
    Rikard

    #1462278

    Hello Rikard,
    thanks again for trying. Which browser did you use for testing?
    If I add your code, it kills my white mobile menu color.
    The mobile menu for mobile phones looks perfect, there is no problem.
    The problem is always the desktop version there is still no change with your codes.
    Do you have any other idea?
    Kind regards,
    Nina

    #1462301

    Hi,

    If you don’t want it to apply to mobile devices, then please try this instead:

    @media only screen and (min-width: 768px) {
    .page-id-26 nav.main_menu li a, .page-id-362 nav.main_menu li a, .page-id-26 .av_header_transparency nav.main_menu li a, .page-id-362 .av_header_transparency nav.main_menu li a  {
      color: #8b1a1a !important;
    }
    }

    Best regards,
    Rikard

    #1462389

    Hi Rikard,
    thanks again for trying. It’s still not fully working.
    The menu buttons on the “Willkommen” page appear still in white instead of the #8b1a1a – red.
    On the “Fit&Schön” page it’s the same. White menu buttons instead of the #8b1a1a – red.
    I’ve tested it on Opera, Google Chrome and Safari.
    Positive: The mobile view has not changed this time. That part of the code worked.
    Do you have any other idea?
    Kind regards,
    Nina

    #1462414

    Hi,

    Thanks for the update, I’m not sure which buttons you are referring to though?

    Best regards,
    Rikard

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