Site logo

[Resolved] menu doesn’t work with custom links removing #

Home Forums Support [Resolved] menu doesn’t work with custom links removing #

Home Forums Support menu doesn’t work with custom links removing #

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #2458838
    David
    Staff
    Customer Support

    In the Menu builder you can add Classes to the menu items – see here:

    https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes

    Add a class to the ones you want to target eg. obfuscated

    It will add the class to the menu-item li. So you can then use it in my CSS like so:

    
    .menu-item-has-children.obfuscated a:not([href]) {
        pointer-events: none;
        position: relative;
    }
    .menu-item-has-children.obfuscated a:not([href]) .dropdown-menu-toggle {
        pointer-events: auto;
        cursor: pointer;
        position: absolute;
        left: 0;
        right:0;
        text-align: right;
    }
    #2459491
    Yohann

    Hello I am sorry but I think I am not clear enough
    When I use generatepress menu, if I remove the # in custom links, the menu immediately close.
    So it is not a trouble of any plugin, but a trouble in the theme. I have this even when I remove the obfuscation plugin.
    The trouble is #/no#
    So the only thing to do, is to try to correct this in generate press.
    The solution you gave me doesn’t work.
    Do you have an idea or I forget…
    Thank you

    #2460135
    David
    Staff
    Customer Support

    When I use generatepress menu, if I remove the # in custom links, the menu immediately close.

    This i cannot replicate. Where can i see this ?

    #2463313
    Yohann

    You can see it on all the links of the menu
    For example when you click on PARAÎTRE PLUS JEUNE on first line … you will see that it doesn’t open the submenu but close immediately all the off Canva menu

    #2463353
    Ying
    Staff
    Customer Support

    Hi Yohann,

    The menu item PARAÎTRE PLUS JEUNE link is not a simple #but something else as you can see in the below screenshot, how did you add the menu item?
    https://www.screencast.com/t/u5wuu8Ecipyu

    And for other parent menu items, none of them has “#” as a link, but I tried in the developer tool and they all worked as expected.

    #2466678
    Yohann

    Hello, to simplify I have created a new test menu
    You have TEST TIRE # and NO#
    When it is NO#, I have removed the #.
    Than you will see that it doesn’t work.
    If we use the last CSS you gave me, the submenu links don’t work.
    So the easiest thing to do, is to correct the automatic closing menu, when we remove # on custom links.
    Is it more comprehensive ?

    #2466799
    David
    Staff
    Customer Support

    But the purpose of my CSS here and/or here was to to stop the link from being clickable and have the Toggle span the entire item. So when you click on the item it simply toggles open and close.

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