Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1076213
    jorimdeporim
    Participant

    Hi!

    I’d like to add the WPML language selector to the topbar. I’ve seen a couple of threads concerning this, but they require the uploading of PHP files. Is there a way to do this in the customizer? For instance, adding a shortcode?

    Thanks in advance!

    #1076345
    Paul R
    Moderator

    Hi,

    Thanks for writing in!

    You need to add this first in your child theme’s functions.php file.

    
    
    //[wpml_lang_selector]
    function wpml_shortcode_func(){
        do_action('icl_language_selector');
    }
    add_shortcode( 'wpml_lang_selector', 'wpml_shortcode_func' );
    add_filter('x_option_x_topbar_content', 'do_shortcode');
    

    http://screencast.com/t/mY9J8TTYeihC

    Then add this in Header > Topbar content in the customizer

    [wpml_lang_selector]

    http://screencast.com/t/aFC0Xykf

    Hope that helps.

    #1076720
    jorimdeporim
    Participant

    It worked, thanks!

    #1076784
    Prasant Rai
    Moderator

    You are most welcome. 🙂

  • <script> jQuery(function($){ $("#no-reply-1076213 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>