Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter stefacht

    (@stefacht)

    I’ve deactivated the widget in the sidebar and built a language selection manually in the header now.
    But how can I make links that don’t only link to language’s homepage, but to the same content page?

    i ld really like to see an answer about this issue from the devs

    thanks

    To place the Multilingual Press Language Switcher widget in the header of your theme, follow these steps:

    1) Register a new sidebar widget region
    Place the following code in your functions.php:

    ///////////////////////////////////////
    // Create a widget region for the
    // Multilingual Press lang switcher
    ///////////////////////////////////////
    if ( function_exists('register_sidebar') ) {
    	register_sidebar(array(
    		'name' => 'Language Switcher',
    		'id' => 'language-switcher',
    		'before_widget' => '<div>',
    		'after_widget' => '</div>'
    	));
    }

    With this code in place, you will now see a new widget region in the Appearance / Widgets area of the admin, called Language Switcher. Drag the Multilingual Press Widget into this new widget region.

    2) Display the language switcher in your theme’s header
    Place the following code in your <header>, usually found in header.php:

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Language Switcher') ) : ?><?php endif; ?>

    Now, all that remains is to style the language switcher as needed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Multilingual Press] How to insert a language selection in the header?’ is closed to new replies.