Title: Language switcher in header.php
Last modified: July 19, 2019

---

# Language switcher in header.php

 *  Resolved [atanasprodanov](https://wordpress.org/support/users/atanasprodanov/)
 * (@atanasprodanov)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/language-switcher-in-header-php/)
 * Hello,
 * I am trying to place a Custom language switch in my header.php file.
    Currently,
   I am using multisite. I am pasting the widget code `<?php if ( function_exists('
   the_msls' ) ) the_msls(); ?>` however it wont position on the right hand side
   beside the Contact (Контакт) button (check the image below)
 * Any help would be much appreciated !
    [Image of current position](http://oi64.tinypic.com/15729og.jpg)
 *     ```
       <?php
       /**
        * Header template.
        *
        * @package Avada
        * @subpackage Templates
        */
   
       // Do not allow directly accessing this file.
       if ( ! defined( 'ABSPATH' ) ) {
       	exit( 'Direct script access denied.' );
       }
       ?>
       <!DOCTYPE html>
       <html class="<?php avada_the_html_class(); ?>" <?php language_attributes(); ?>>
       <head>
       	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
       	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
       	<?php Avada()->head->the_viewport(); ?>
   
       	<?php wp_head(); ?>
   
       	<?php $object_id = get_queried_object_id(); ?>
       	<?php $c_page_id = Avada()->fusion_library->get_page_id(); ?>
   
       	<script type="text/javascript">
       		var doc = document.documentElement;
       		doc.setAttribute('data-useragent', navigator.userAgent);
       	</script>
   
       	<?php
       	/**
       	 *
       	 * The settings below are not sanitized.
       	 * In order to be able to take advantage of this,
       	 * a user would have to gain access to the database
       	 * in which case this is the least on your worries.
       	 */
       	echo apply_filters( 'avada_google_analytics', Avada()->settings->get( 'google_analytics' ) ); // WPCS: XSS ok.
       	echo apply_filters( 'avada_space_head', Avada()->settings->get( 'space_head' ) ); // WPCS: XSS ok.
       	?>
       </head>
   
       <?php
       $wrapper_class = ( is_page_template( 'blank.php' ) ) ? 'wrapper_blank' : '';
   
       if ( 'modern' === Avada()->settings->get( 'mobile_menu_design' ) ) {
       	$mobile_logo_pos = strtolower( Avada()->settings->get( 'logo_alignment' ) );
       	if ( 'center' === strtolower( Avada()->settings->get( 'logo_alignment' ) ) ) {
       		$mobile_logo_pos = 'left';
       	}
       }
   
       ?>
       <body <?php body_class(); ?>>
       	<!-- Google Tag Manager (noscript) -->
       <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KWKCLCR"
       height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
       <!-- End Google Tag Manager (noscript) -->
       	<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'Avada' ); ?></a>
       	<?php
       	do_action( 'avada_before_body_content' );
   
       	$boxed_side_header_right = false;
       	$page_bg_layout          = 'default';
       	if ( $c_page_id && is_numeric( $c_page_id ) ) {
       		$fpo_page_bg_layout = get_post_meta( $c_page_id, 'pyre_page_bg_layout', true );
       		$page_bg_layout     = ( $fpo_page_bg_layout ) ? $fpo_page_bg_layout : $page_bg_layout;
       	}
   
       	?>
       	<?php if ( ( ( 'Boxed' === Avada()->settings->get( 'layout' ) && ( 'default' === $page_bg_layout || '' == $page_bg_layout ) ) || 'boxed' === $page_bg_layout ) && 'Top' != Avada()->settings->get( 'header_position' ) ) : ?>
       		<div id="boxed-wrapper">
       	<?php endif; ?>
       	<?php if ( ( ( 'Boxed' === Avada()->settings->get( 'layout' ) && 'default' === $page_bg_layout ) || 'boxed' === $page_bg_layout ) && 'framed' === Avada()->settings->get( 'scroll_offset' ) ) : ?>
       		<div class="fusion-sides-frame"></div>
       	<?php endif; ?>
       	<div id="wrapper" class="<?php echo esc_attr( $wrapper_class ); ?>">
       		<div id="home" style="position:relative;top:-1px;"></div>
       		<?php avada_header_template( 'Below', ( is_archive() || Avada_Helper::bbp_is_topic_tag() ) && ! ( class_exists( 'WooCommerce' ) && is_shop() ) ); ?>
       		<?php if ( 'Left' === Avada()->settings->get( 'header_position' ) || 'Right' === Avada()->settings->get( 'header_position' ) ) : ?>
       			<?php avada_side_header(); ?>
       		<?php endif; ?>
       		<?php if ( function_exists( 'the_msls' ) ) the_msls(); ?>
   
       		<?php avada_sliders_container(); ?>
   
       		<?php avada_header_template( 'Above', ( is_archive() || Avada_Helper::bbp_is_topic_tag() ) && ! ( class_exists( 'WooCommerce' ) && is_shop() ) ); ?>
   
       		<?php if ( has_action( 'avada_override_current_page_title_bar' ) ) : ?>
       			<?php do_action( 'avada_override_current_page_title_bar', $c_page_id ); ?>
       		<?php else : ?>
       			<?php avada_current_page_title_bar( $c_page_id ); ?>
       		<?php endif; ?>
       		<?php do_action( 'avada_after_page_title_bar' ); ?>
       		<?php
       		$main_css   = '';
       		$row_css    = '';
       		$main_class = '';
   
       		if ( apply_filters( 'fusion_is_hundred_percent_template', false, $c_page_id ) ) {
       			$main_css         = 'padding-left:0px;padding-right:0px;';
       			$hundredp_padding = get_post_meta( $c_page_id, 'pyre_hundredp_padding', true );
       			if ( Avada()->settings->get( 'hundredp_padding' ) && ! $hundredp_padding ) {
       				$main_css = 'padding-left:' . Avada()->settings->get( 'hundredp_padding' ) . ';padding-right:' . Avada()->settings->get( 'hundredp_padding' );
       			}
       			if ( $hundredp_padding ) {
       				$main_css = 'padding-left:' . $hundredp_padding . ';padding-right:' . $hundredp_padding;
       			}
       			$row_css    = 'max-width:100%;';
       			$main_class = 'width-100';
       		}
       		do_action( 'avada_before_main_container' );
       		?>
       		<main id="main" class="clearfix <?php echo esc_attr( $main_class ); ?>" style="<?php echo esc_attr( $main_css ); ?>">
       			<div class="fusion-row" style="<?php echo esc_attr( $row_css ); ?>">
       ```
   
    -  This topic was modified 6 years, 10 months ago by [atanasprodanov](https://wordpress.org/support/users/atanasprodanov/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flanguage-switcher-in-header-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Language switcher in header.php’ is closed to new replies.

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [header.php](https://wordpress.org/support/topic-tag/header-php/)
 * [main menu](https://wordpress.org/support/topic-tag/main-menu/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [atanasprodanov](https://wordpress.org/support/users/atanasprodanov/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/language-switcher-in-header-php/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
