WPML Language switcher position at topbar

Hello,

How can the language switcher be placed on the top bar where the social icons are? So it could be same row as social icons. That way switchers are not hanging at the end of the menu on mobile device.

Thank you very much

Hi,

To achieve that, create file _topbar.php in wp-content/themes/x-child/framework/legacy/cranium/headers/views/global. Then copy and paste the code below into that file.

<?php

// =============================================================================
// VIEWS/GLOBAL/_TOPBAR.PHP
// -----------------------------------------------------------------------------
// Includes topbar output.
// =============================================================================

?>

<?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>

  <div class="x-topbar">
    <div class="x-topbar-inner x-container max width">
      <span class="my-lswitcher" style="float:right;margin-left:20px;"><?php do_action('icl_language_selector'); ?></span>
      <?php x_social_global(); ?>
      <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
      <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
      <?php endif; ?>
      
    </div>
  </div>

<?php endif; ?>

Please note that these directories does not exist yet in your child theme.

legacy/cranium/headers/views/global

You will need to create it

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.