Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #114747
    simocasti
    Participant

    hi,

    i would use the WPML language selector on top bar, from the support of the plugin they say to insert this

    <?php do_action('icl_language_selector'); ?>

    where i want the language selector, but in the top bar this is not working for me, it’s possible that is deactivated the use of php for this area? or what else?

    thank you.
    simone

    #114754
    Paul R
    Moderator

    Hi Simone,

    Thanks for writing in.

    To do that, you need to set up a child theme first.

    How to Setup Child Themes

    Then create file _topbar.php in {x child folder}/framework/views/global

    Paste the code below into that file.

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // -----------------------------------------------------------------------------
    // Includes topbar output.
    // =============================================================================
    
    ?>
    
    <?php if ( x_get_option( 'x_topbar_display', 0 ) == 1 ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container-fluid max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
          <div class="wpml-selector"><?php do_action('icl_language_selector'); ?></div>
        </div>
      </div>
    
    <?php endif; ?>
    
    #114763
    simocasti
    Participant

    thank you very much for the fast answer.

    simone

    #114768
    Cousett
    Member

    Glad we were able to help. 🙂 Have a nice day.

    #132890
    buhlig
    Participant

    Great help, but any idea how to display the language flags horizontally?

    #132962
    Kosher K
    Member

    Hi There,

    Thanks for writing in,

    Third party plugin such as WMPL is out of the support we can offer, Please contact wpml regarding this matter,

    This article might also help http://wpml.org/forums/topic/only-flags-in-dropdown-language-selector/

    Have a great day

    #375195
    svennuum
    Participant

    Hello,

    I managed to get the flags to topbar, but there is slight issue. How can I change the color behing the flags, theres is one annoying white area.

    http://boost.ee/

    Thanks!
    Sven

    #375314
    Paul R
    Moderator

    Hi Sven,

    To remove the white background, you can add this under Custom > CSS in the Customizer.

    
    .home #lang_sel_list a.lang_sel_sel, #lang_sel_list a.lang_sel_sel:visited {
        background-color: transparent;
        border: 0;
    }
    
    .home #lang_sel_list ul {
        border-top: 0;
    }
    

    Hope that helps.

    #375353
    svennuum
    Participant

    Thanks! It helped, but same things occurs when adding second language.. http://boost.ee/

    #375407
    Paul R
    Moderator

    Hi,

    Please add this code as well.

    
    #lang_sel_list ul a.lang_sel_other, #lang_sel li ul a:link, #lang_sel_list ul a.lang_sel_other:visited {
        background-color: transparent;
    }
    

    Hope that helps.

    #375477
    svennuum
    Participant

    It still appears on other pages http://boost.ee/shop/

    #375532
    Thai
    Moderator

    Hi There,

    Upon checking your website, I can’t see the language switcher.

    Could you please activate it again?

    Thanks.

    #375842
    svennuum
    Participant

    Yeah, sure. Sorry http://boost.ee/shop/

    #375985
    Nabeel A
    Moderator

    Hi again,

    Please add the following code to remove the white background:

    #lang_sel_list a.lang_sel_sel, #lang_sel_list a.lang_sel_sel:visited {
        background-color: transparent !important;
    }
    
    #lang_sel_list ul {
        border-top: none !important;
    }

    Let us know how this goes!

    #376456
    svennuum
    Participant

    Worked very well, thanks a lot! 🙂

    Just one more thing regarding to smartphone viewport.

    How could I manage to arrange the topbar social icons and language selector to on line, that it wouldnt take so much space?

    Screenshot http://boost.ee/wp-content/uploads/2015/09/Photo-02-09-15-12-50-07.png

    Thanks and keep up the awesome work!
    Sven

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