Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1228907
    Elea
    Participant

    Hello.

    I am prety new into xtheme and wordpress in general.

    i have little problem with WPML language switcher. I have looked around web. I do not know if i am googling wrong thing or i am trying things wrong way.

    Anyway i need to place language switcher into xtheme header in the right side.
    I have downloaded also child theme but apart from it i really do not know what code i need to add there to make it work.

    I also included picture so maybe people will understand then better what i meaned.

    #1229261
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in!

    Please walk-through following thread to implement language switcher:

    https://community.theme.co/forums/topic/wpml-language-switcher-ul-etc/#post-1029448

    Thanks.

    #1230503
    Elea
    Participant

    I am not sure what i am doing wrong.
    But i keep geting different flavours of “Call to undefined function” errors.

    Edit:
    Okay. I start to get little hang on it. I mistakenly used functions.php …..
    ( Protip. Never do things when you are sleepy )

    As i understand i needed to copy some file into same location in child theme.
    I did it. Now does it have to show up in apperance editor ? Since i have no idea if it has to.

    Anyway. I changed also that code but WPML language switcher does not seem to show up no matter what.
    i used _topbar.php

    One friend said that i should use xlogobar instead but since he is terribly busy all the the time he could not help me right now more than that.

    I dont even know what file i need to change to edit xlogobar

    Edit2:
    It actually works in “topbar”( it was disabled) but i do not want it in top bar.
    I need it in the same area where logo is but right side

    #1230962
    Christopher
    Moderator

    Hi there,

    Please connect to FTP account and copy the file _navbar.php from framework/views/global and put it in the same path inside child theme, replace existing code with following :

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_NAVBAR.PHP
    // -----------------------------------------------------------------------------
    // Outputs the navbar.
    // =============================================================================
    
    $navbar_position = x_get_navbar_positioning();
    $logo_nav_layout = x_get_logo_navigation_layout();
    $is_one_page_nav = x_is_one_page_navigation();
    
    ?>
    
    <?php if ( ( $navbar_position == 'static-top' || $navbar_position == 'fixed-top' || $is_one_page_nav ) && $logo_nav_layout == 'stacked' ) : ?>
    
      <div class="x-logobar">
        <div class="x-logobar-inner">
          <div class="x-container max width">
            <?php x_get_view( 'global', '_brand' ); ?>
            <div class="wpml-selector"><?php do_action('icl_language_selector'); ?></div>
          </div>
        </div>
      </div>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>
            </div>
          </div>
        </div>
      </div>
    
    <?php else : ?>
    
      <div class="x-navbar-wrap">
        <div class="<?php x_navbar_class(); ?>">
          <div class="x-navbar-inner">
            <div class="x-container max width">
              <?php x_get_view( 'global', '_brand' ); ?>
              <?php x_get_view( 'global', '_nav', 'primary' ); ?>
            </div>
          </div>
        </div>
      </div>
    
    <?php endif; ?>

    Hope it helps.

    #1233385
    Elea
    Participant

    Yes it works. but appears under logo in left side.
    I tryed align it in css under customizer css code.
    But it does not seem to work.

    .wpml-selector {
      text-align: right;
    }

    EDIT:

    I used wrong CSS options.
    that is how it worked:

    
    /* Language switcher */
    .wpml-selector {
      position: absolute;
      right: 5%;
      bottom: 0.5%;
    }

    But only problem what remains is thing that it breaks in mobile view.
    So we probably are going to use top bar route either way.
    If someone knows how i could fix it. I would be happy.

    But my original problem has been resolved.

    #1233856
    Rad
    Moderator

    Hi there,

    You could try wrapping it with @media so mobile will not be affected. Example.

    @media (min-width: 768px) {
    
    .wpml-selector {
      position: absolute;
      right: 5%;
      bottom: 0.5%;
    }
    
    }

    And please provide your site’s URL.

    Thanks!

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