WPML language switcher in topbar does not show

Hello to you all, I’m trying to creat a WPML language switcher (flag only) and tied doing that by following instructions from other threads. But no flag is showing in the topbar. Can you tell me what I missed?

  1. turned on Topbar in the Customizer

  2. Enabled WPML language switcher in custom locations

  3. Created this _topbar.php file in wp-content>themes>x-child>framework>views>global

    <?php

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

    ?>

    <?php if ( x_get_option( 'x_topbar_display', 0 ) == 1 ) : ?> <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?> <?php echo x_get_option( 'x_topbar_content' ); ?> <?php endif; ?> <?php do_action('icl_language_selector');?> <?php x_social_global(); ?> <?php endif; ?>

Thanks!

Hi @blueprint,

It seems that you have not activated the CHild Theme. I went ahead and activated it and now the Flags are coming up at topbar.

Thanks

Oh, ok that’s a little embarrassing :grimacing: Thanks a lot!

Since I did all the changes without turning on Child Theme, what do I have to do to maintain all the changes with the next Theme update?

Could you give me a code to change the position of the flags? Center / right
and the spacings above and below the flags as well as between the two flags?

Thank you!!!

Meanwhile I did this to hide flags on mobile devices (or when the menu collapses) and center the flags:

@media (min-width: 980px)
{
.wpml-ls {
display: none !important;
}
}

@media(max-width: 980px){
.wpml-ls {
text-align: center !important;
margin-bottom: -0.7em;
}

It looks right, but is this the right way to do it? (I’m no expert in coding. Just tried what worked)

Hello @blueprint,

The topbar _topbar.php file must be in the child theme so that when there is a theme update, those modifications will stay intact and still work.

The custom CSS is working as expected. Your solution is the correct way of implementing your changes.

Best Regards.

Thanks a lot!

Hi @blueprint,

You’re welcome and it’s our pleasure to help you! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

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