-
AuthorPosts
-
February 5, 2023 at 12:24 pm #1396733
Hello.
I have a link in the nav built as an overview for the sub links. This page can be called up in the desk menu. In the burger, the link appears and when you click on it, the subpages become visible. But I can’t click on this link in the burger. How do I do that? I would like to be able to click on this link in the burger as well to go to the page and not just for the show of the child links.February 5, 2023 at 1:15 pm #1396736Hey frasche,
Please use the theme settings at Enfold Theme Options ▸ Main Menu ▸ Burger/Mobile Menu ▸ Clone title menu items to submenu
Then will clone the parent menu item so that in it’s dropdown on mobile you will have the option to go to the parent item link.
On mobile you can’t have the parent item open a drop-down on click and go to the link on click, on mobile there is not hover action.
If you would like to change the parent item name try this solution, if you are not sure how to adjust the code for your site please like yo your site and tell us what new name you wish to use so we can help.
Most often people find using the standard Clone title is fine.Best regards,
MikeFebruary 10, 2023 at 10:25 am #1397421Hi,
i try u example code, but it not work. I want the change the Text “EXKLUSIVMARKEN” in the mobile menu in “ALLE EXKLUSIVMARKEN”. i put this in code in my funktion php:
———————————————
function replace_burger_menu_parent_cloned_menu_item_text() { ?>
<script>
window.addEventListener(‘DOMContentLoaded’, function() {
(function($){
$(‘.avia_mobile’).on(‘click’, ‘.av-burger-menu-main’, function() {
$(‘.menu-item-8843 .avia-menu-text:first’).text(function(index, text) {
return text.replace(‘EXKLUSIVMARKEN’, ‘ALLE EXKLUSIVMARKEN’);
});
});
}(jQuery));
});
</script>
<?php
}
add_action(‘wp_footer’, ‘replace_burger_menu_parent_cloned_menu_item_text’);February 10, 2023 at 12:52 pm #1397451Hi,
Thanks for the feedback I tested this function and it seems to work, please include an admin login in the Private Content area so I can test in your site, perhaps the quotes became curly quotes in your functions.phpfunction replace_burger_menu_parent_cloned_menu_item_text() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $('.avia_mobile').on('click', '.av-burger-menu-main', function() { $('.menu-item-8843 .avia-menu-text:first').text(function(index, text) { return text.replace('EXKLUSIVMARKEN', 'ALLE EXKLUSIVMARKEN'); }); }); }(jQuery)); }); </script> <?php } add_action('wp_footer', 'replace_burger_menu_parent_cloned_menu_item_text');
Best regards,
MikeFebruary 11, 2023 at 3:21 am #1397520Thank you. Yes it works but not the way I need it. I need “Exklusivmaken” as the first link at the top and then “All Exklusivmarken” as the first link in the submenu. Exactly the opposite of how it is now.
February 11, 2023 at 12:55 pm #1397550Hi,
Thanks for the feedback, but it looks like you have already modified the script to change the second one, I see this on your site now:(function($){ $('.avia_mobile').on('click', '.av-burger-menu-main', function() { $('.menu-item-8843 .sub-menu .avia-menu-text:first').text(function(index, text) { return text.replace(/(ALLE )?EXKLUSIVMARKEN/, 'ALLE EXKLUSIVMARKEN'); }); }); }(jQuery));
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.