[Resolved] Impossible to modify the active menu button via CSS when it leads to a post.

Home Forums Support [Resolved] Impossible to modify the active menu button via CSS when it leads to a post.

Home Forums Support Impossible to modify the active menu button via CSS when it leads to a post.

  • This topic has 21 replies, 3 voices, and was last updated 2 years ago by Luiz Guilherme.
Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #1519961
    Luiz Guilherme

    In GeneratePress Free, it is not possible to define a color for a menu option when this option is selected.

    For some reason, when a menu item is created that points to a “Post“, the “current-menu-item” class is not added.

    Therefore, it is not possible to modify this button when it is active.

    #1519963
    Luiz Guilherme

    Note: If when creating the button, I use the “LINK” option and manually enter the post address, instead of using the “POST” option the error does not occur.

    #1520278
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to your site where i can see the issue and get a better understanding of the problem.

    #1520681
    Luiz Guilherme

    Site:
    https://pestalozzipontobelo.com.br/

    I use the follow CSS code to change color of the selected menu buttom.

    /* MAIN MENU */
    /* Selected Menu */
    .main-nav ul li[class*="current-menu-"] > a,
    /* Mobile Menu */
    .menu-toggle[aria-expanded="true"]
    {
      background-color: #ffca08!important;
      color: #515151!important;
    }

    But Doesn’t work when a menu buttom is created by select the “POST” on screen of “Menu Edit”.

    The button created this way doesn’t have the class “current-menu-item“.
    And this class is need on this part of css:
    .main-nav ul li[class*=”current-menu-“] > a

    The problem also occour on mobile menu.

    Test yourself: See that when you select the TRANSPARENCIA 2 menu it does not change color.

    #1520727
    Luiz Guilherme

    Test yourself:

    See that when you select the TRANSPARENCIA 2 menu it does not change color.

    #1520729
    Luiz Guilherme

    I would like to take the opportunity to report another failure:

    In wordpress, when something is not found it displays a search field, but on this site, the “Search” button has a layout problem.

    See this link:
    https://pestalozzipontobelo.com.br/category/lojinha/

    #1520754
    David
    Staff
    Customer Support

    How is the TRANSPARENCIA 2 page set up?
    If i inspect TRANSPARENCIA 2 in the developer tools it is defined as a PAGE. Whereas the Menu Item link is defined as a Post. This is not normal behaviour.

    #1520851
    Luiz Guilherme
    #1520942
    David
    Staff
    Customer Support

    Do you have a Page with the same title as the Post ?

    See here – the link takes you to this which is a Page:

    #1520960
    Luiz Guilherme

    01 – Perfect, that was it. I had created a page first, so I changed my mind and decided to use a Post, but do not delete the page.
    With the exclusion of the page everything is working fine.

    02 – What about the Search button that is not displayed correctly?

    #1521501
    David
    Staff
    Customer Support

    Can you try changing the Customizer > General –> Icon Type to SVG

    #1521788
    Luiz Guilherme

    It worked.

    I defined the font, because in the future I intend to create a package of personalized fonts, following instructions that I had here
    https://generatepress.com/forums/topic/how-to-display-other-icons-fonts-besides-the-magnifying-glass/#post-1438058

    I have other old sites that I use the “font” option and the text “Search” is displayed instead of the “magnifying glass” icon.

    Does the “Font” option no longer work?

    #1522018
    David
    Staff
    Customer Support

    It should work – try switching back to Icon > Font and clear any caches.

    #1522065
    Luiz Guilherme

    I tried this, the error persists whenever I re-active the “Fonts” option.

    Even on the smartphone, regardless of the browser used, the error occurs.

    I have also tried to disable all plugins and the error occurs.

    I use a child theme on this site, so I tried to activate only the parent theme, and the error persists.

    I am using WordPress version 5.5.3 – pt_BR.

    #1522419
    David
    Staff
    Customer Support

    Weird. Maybe leave it as Icon. You can use Filter to switch them – heres an example of that:

    https://generatepress.com/forums/topic/svg-menu-icon-bars-fatter/#post-1520827

    Happy to help if you need assistance switching any of them over to your own SVGS.

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