Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1407386
    JulieBDB
    Participant

    Hello,

    I would like to place the language switcher in the top right corner of the top bar but I can’t find where the php file is. I have set up a Renew child theme.

    1/ Please confirm I should us this guidelines
    https://community.theme.co/forums/topic/wmpl-switcher-in-the-topbar/

    2/ Where can I access my php.file please?

    I’ll share my website credentials with you in another message.

    Many thanks in advance
    Kind regards,
    Julie

    #1407389
    JulieBDB
    Participant
    This reply has been marked as private.
    #1407676
    Lely
    Moderator

    Hello Julie,

    Yes, we can use that thread as guide.
    I can see you have a child theme already.
    Copy _topbar.php from this folder \wp-content\themes\x\framework\views\global to your child theme here: \wp-content\themes\x-child\framework\views\global. Open the copied file, add the following line:

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

    After this part:

          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>

    Hope this helps.

    #1410439
    JulieBDB
    Participant
    This reply has been marked as private.
    #1410842
    Friech
    Moderator

    Hi Julie,

    Please follow this guide thoroughly, login to your server via FTP and navigate to this directory: \wp-content\themes\x-child\framework\views\global\, there create a file named _topbar.php (if it is exist then open and edit that file). Replace the entire existing content of that _topbar.php file with the code below.

    <?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">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <div class="lang-switcher right"><?php echo do_shortcode( '[wpml_language_selector_widget]' ); ?></div>
          <?php x_social_global(); ?>
        </div>
      </div>
    
    <?php endif; ?>

    This should be the entire content of your _topbar.php file now. Then save.

    Your site has a caching plugin, so make sure you clear that before you preview the site.

    Hope it helps, Cheers!

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