Mobil menu

Latest Reply from Dave at 2016-10-17 04:23:36
Dear SMT!

I'd like help.
The mobile menu appears in the html code (<br>).
The theme WordGrass the problem does not occur.

Thanks!
Hi!
Could you give me the URL of your website, please.
Hi!

www.thetaworld.hu

This happens bacause menu items doesn't contain html tags by default. It must be just words. If you added html tags to the menu items, you may find the script:
function block_main_menu_mobile() {
?>
<script>
jQuery(document).ready(function(){
jQuery('.menu-primary li').each(function() {
jQuery('<option />', {
'value':jQuery(this).find('a').attr('href'),
'text':jQuery(this).find('a').html()
}).appendTo(jQuery('#mobile-main-menu'));
});
});
</script>
<?php
}

in the functions.php file of the theme and try to edit it according to your needs. For example, you may replace the line:
'text':jQuery(this).find('a').html()

with:
'text':jQuery(this).find('a').text()

Leave a reply

Add codeAdd image