-
AuthorPosts
-
March 20, 2018 at 4:14 pm #929908
Hi,
I would like to add the language switcher of the MultilingualPress plugin in ENFOLD’s header area – but in the small sub-menu next to the social icons.
I am using this header layout:
I tried to add a header widget area like it is mentioned here:
but then it adds the language switcher box to the main menu area below this small sub-menu stripe.
Can you please tell me how to add such a “header widget area” to the sub-menu stripe (https://imgur.com/NHe15J6) ?
It is working in some way, because he had success in adding the switcher box:
https://kriesi.at/support/topic/multilingualpress-language-switcher-in-secondary-header/Thank you.
March 21, 2018 at 6:31 am #930337Hey Gitte,
To be able to add the language switcher there you need to edit the header.php file, after activating a child theme and copying this file there.
Or we could try to move the switcher there from the main header area by means of css, if that is feasible.
If you need further assistance please let us know.
Best regards,
VictoriaMarch 21, 2018 at 5:02 pm #930676thanks, and what about a header widget area, doesn’t this work?
And why the header.php, there is not much in this file – for adding the flags to the submenu resp. next to the social icons: wouldn’t it be better to use helper-main-menu.php?
March 22, 2018 at 1:46 pm #931275Hi Gitte,
Yes, you’re correct, it’s the helper-main-menu.php file that has all the menus in it.
Best regards,
VictoriaMarch 22, 2018 at 1:54 pm #931283okay, then back to my first post’s question, you still haven’t answered it:
Can you please tell me how to add such a “header widget area” to the sub-menu stripe (https://imgur.com/NHe15J6) ?
It is working in some way, because he had success in adding the switcher box:
https://kriesi.at/support/topic/multilingualpress-language-switcher-in-secondary-header/March 23, 2018 at 10:19 am #931871Hi Gitte,
Do you have the code or the shortcode for adding that element?
Best regards,
VictoriaMarch 23, 2018 at 11:38 am #931927Hi,
yes, I have a snippet, but due to I am not a coder, I don’t know how to add this to a header-widget-area within the submenu (not main menu!):
<?php if( function_exists( 'mlp_show_linked_elements' ) ) : mlp_show_linked_elements( array( 'link_text' => 'flag', // oder 'text' oder 'text_flag' 'show_current_blog' => TRUE // TRUE - display the current language, FALSE - hide the current language (default) ) ); endif; ?>
March 24, 2018 at 6:05 pm #932431Hi,
That snippet can only be added on the functions.php file ( from what I see it includes ) and not to widget.
Does it also have maybe a function that prints the things out?Best regards,
BasilisMarch 24, 2018 at 9:12 pm #932482hm, no … that is the only snippet I got from them that I should add in the menu area for a language switcher, that connects the German and the English version of a post/page:
https://github.com/inpsyde/MultilingualPress/wiki/Public-Functions
March 27, 2018 at 3:30 am #933299Hi,
Thank you the update.
Please replace the function with the following code.
function mlp_show_linked_elements_mod() { if( function_exists( 'mlp_show_linked_elements' ) ) { return mlp_show_linked_elements( array( 'link_text' => 'flag', // oder 'text' oder 'text_flag' 'show_current_blog' => TRUE // TRUE - display the current language, FALSE - hide the current language (default) ) ); } } add_shortcode( 'mlp_show', 'mlp_show_linked_elements_mod' );
Use the shortcode in a text widget.
[mlp_show]
I’m not sure what the function actually returns so you should ask the plugin author for more info.
Best regards,
IsmaelMarch 27, 2018 at 11:34 am #933581It works perfectly, thank you so much, Ismael!!!!!
March 27, 2018 at 12:39 pm #933602 -
AuthorPosts
- The topic ‘MultilingualPress language switcher in ENFOLD header widget area’ is closed to new replies.