Tagged: polylang
-
AuthorPosts
-
June 22, 2018 at 10:16 am #976206
Hi support
I’m using Polylang
I’ve been adding flags on a site with php+CSS code.
Everything is ok, but the function below hide the Enfold burger menu whenever the site is on a phone.I’ve duplicate helper-main-menu.php and place it in my child theme in a folder named includes/helper-main-menu.php
Here’s the code I’ve add line 148* /Hook that can be used for plugins and theme extensions */ do_action('ava_after_main_menu');?> <?php // outputs a flags list (without languages names) ?> <div id="polylangMenu"> <ul class="lang-switch"><?php pll_the_languages(array('show_flags'=>1,'show_names'=>0));?></ul> </div>
How can I hide it for the mobile display (so the enfold burger menu aooear).
Many thanks !!
June 22, 2018 at 11:32 am #976256Hey Ikyo,
You can add this css code in Quick CSS (located in Enfold > General Styling):
@media only screen and (max-width:767px) { #polylangMenu { display: none !important; } }
Hope it helps :)
Best regards,
NikkoJune 22, 2018 at 11:39 am #976264Thanks for your so quick answer.
I tried to before aking the question, but without success
As it’s a php inclusion on the header (in helper-main-menu.php) , it may overide the responsive menu and hide it sustainablyThe mobile menu is back when I remove the php code describe above (of copurse)
But it not really help (except that the mobile menu doaes really work).Thanks for your kindfull help one more time
King regardsJune 23, 2018 at 9:33 am #976859Hi Ikyo,
Thanks for giving us the link to your site.
I inspected it and noticed that the burger menu isn’t there at all, have you modified header.php also?Best regards,
NikkoJune 24, 2018 at 8:48 am #977123#OMG
I underated the fact that the modified header.php was not up to date (according to the last version).
I update it, and it works ! MANY thanks Nikko !For the record, I indicate how to add flags horizontal flags in the header when using polylang.
1/ copy paste includes/helper-main-menu.php in the child theme
2/ replace
do_action('ava_after_main_menu'); // todo: replace action with filter, might break user customizations
l.193
bydo_action('ava_after_main_menu');?> <?php // outputs a flags list (without languages names) ?> <div id="polylangMenu"> <ul class="lang-switch"> <?php pll_the_languages(array('show_flags'=>1,'show_names'=>0));?> </ul> </div> <?
and add appropriate CSS
- This reply was modified 6 years, 5 months ago by Ikyo.
June 24, 2018 at 7:56 pm #977184Hey!
Glad the problem is solved now!Regards,
Peter -
AuthorPosts
- The topic ‘Polylang 'pll_the_languages' on mobile’ is closed to new replies.