Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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:

    View post on imgur.com

    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.

    #930337

    Hey 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,
    Victoria

    #930676

    thanks, 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?

    #931275

    Hi Gitte,

    Yes, you’re correct, it’s the helper-main-menu.php file that has all the menus in it.

    Best regards,
    Victoria

    #931283

    okay, 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/

    #931871

    Hi Gitte,

    Do you have the code or the shortcode for adding that element?

    Best regards,
    Victoria

    #931927

    Hi,

    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;
    ?>
    #932431

    Hi,

    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,
    Basilis

    #932482

    hm, 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

    #933299

    Hi,

    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,
    Ismael

    #933581

    It works perfectly, thank you so much, Ismael!!!!!

    #933602

    Hey!

    Glad Ismael could help!
    Let us know if you have any other questions or issues :)

    Best regards,
    Yigit

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘MultilingualPress language switcher in ENFOLD header widget area’ is closed to new replies.