- This topic has 21 replies, 4 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 19, 2022 at 3:26 pm #2423436
Yohann
Hello,
I use custom links to create title in my menu and I remove the #
in off Canva menu, when you click on the title , it immediately close the off Canva menu.
Would you know how we could fix it ?
Thank you very much.November 20, 2022 at 5:50 am #2423927David
StaffCustomer SupportHi there,
can i see the site with the issue ?
November 21, 2022 at 3:34 am #2425110Yohann
This is the link https://yderhy-dev-dr-yohann-derhy.pf26.wpserveur.net/
November 21, 2022 at 4:57 am #2425219David
StaffCustomer SupportIs this for the Menu Items with the Icon that have no link?
If yes, then for each of those menu items, give them a CSS class of
no-pointers
This doc show how to add the CSS Class:https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes
Then add this CSS to your site:
.no-pointers { pointer-events: none; }That will make those items “unclickable” so the script wont fire if you do click them.
For the menu items with sub menus those need to have the
#URL.November 24, 2022 at 2:37 am #2430647Yohann
Thank you for your answer. but I want to reduce the links on my page for SEO, and when I use # I automatically create links. Is there a way to change the script like this it won’t fire anymore and I won’t have # in links ?
if I use other themes it works well(for example twenty-one).
So it comes from generatepress. I have a child theme.Thank you for your help.
November 24, 2022 at 3:05 am #2430689David
StaffCustomer SupportRemove the URLs, and try adding this CSS:
.menu-item-has-children a:not([href]) { pointer-events: none; position: relative; } .menu-item-has-children a:not([href]) .dropdown-menu-toggle { pointer-events: auto; cursor: pointer; position: absolute; left: 0; right:0; text-align: right; }November 24, 2022 at 5:01 am #2430875Yohann
Excellent ! this is perfect
Thank you so muchNovember 24, 2022 at 5:06 am #2430879David
StaffCustomer SupportGlad to be of help
December 4, 2022 at 3:07 pm #2449505Yohann
I am sorry to come back but there is a trouble with your solution.
I have obfusq the link in the menu, and with your solution they don’t work…
So I ask you again my first question…
Thank you for your help.December 4, 2022 at 8:24 pm #2449672Fernando Customer Support
Hi Yohann,
For clarity, can you rephrase “I have obfusq the link in the menu”?
If you’re referring to “VOS BESOINS” for instance, can you try David’s suggestion here: https://generatepress.com/forums/topic/menu-doesnt-work-with-custom-links-removing/#post-2425219
December 5, 2022 at 1:27 am #2449893Yohann
I mean I have use obfuscation to hide links …
But when I use the last solution, the obfuscated links doesn’t workAnd when I use the first solution, I have too much links /#
If I use the theme twenty one for example, you can easily remove /# and the menu doesn’t close when I click on custom links without #
How can we fix it please ?
Thank youDecember 5, 2022 at 4:26 am #2450084David
StaffCustomer SupportHow are you obfuscating the links ?
December 5, 2022 at 4:36 am #2450096Yohann
I use a plug-in obf-link
It works well with other themesDecember 5, 2022 at 5:53 am #2450176David
StaffCustomer SupportI am not sure there is an easy fix for that, as GP filters in the Sub Menu using the same filters that plugin will. So it will break the sub menu.
Do you need to obfuscate the links with the option i provided here:
https://generatepress.com/forums/topic/menu-doesnt-work-with-custom-links-removing/#post-2430689
December 11, 2022 at 12:33 pm #2458184Yohann
With this piece of CSS, all the links are obfuscated but we cannot open them…
I need to obfuscate most of those links but not all… With the plugin it is very easy to manage. But maybe we could had a class or something to select the one who will be obfuscated. -
AuthorPosts
- You must be logged in to reply to this topic.