Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #101411

    Hi

    How do i put the google translate flags from this page http://www.nerdproductions.dk/tangent-element-tk up in the menu or in the topbar next to the social icons?

    my site is http://www.nerdproductions.dk/

    i use the Google Language Translator plugin. and have used a shortcode to input the flags.

    i have tried to mess around the the php but can not get it to work

    thanks in advance 🙂

    #101483

    Mrinal
    Member

    Hi Bo,

    Thanks for writing in!

    At first, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Now, open the functions.php file of your child theme. Then add the following codes into it:

    add_filter('theme_x_topbar_content','x_topbar_do_shortcode');
    
    function x_topbar_do_shortcode($content) {
     return do_shortcode( $content );
    }

    Then go to Appearance > Customize > Header > Enable Topbar content & add the shortcode of Translate plugin there.

    Hope these helps, Cheers!

    #101946

    Hi

    thanks for your reply!

    I have done as you told me, but it seems that the shortcode still isnt working. Do you have any suggestions? link: http://www.nerdproductions.dk/

    my functions.php in the child theme now looks like this:

    <?php
    // =============================================================================
    // FUNCTIONS.PHP
    // —————————————————————————–
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================

    add_filter(‘theme_x_topbar_content’,’x_topbar_do_shortcode’);

    function x_topbar_do_shortcode($content) {
    return do_shortcode( $content );
    }
    ?>

    #102037

    Mrinal
    Member

    Hi Bo,

    You’re using slight old version of X theme, At first please update your theme to latest version 2.4.0 by following this KB article: Updating Your Theme and Plugins.

    If the update not resolves the issue then, Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #102620
    This reply has been marked as private.
    #102647

    Paul R
    Moderator

    Hi Bo,

    Sorry about that.

    Can you try the steps below instead.

    1. Create the file /wp-content/themes/x-child-integrity-light/framework/views/global/_topbar.php

    2. Paste the code below in /wp-content/themes/x-child-integrity-light/framework/views/global/_topbar.php

    
    <?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="gtranslate" style="float:right;"><?php echo do_shortcode('[google-translator]'); ?></div>
        </div>
      </div>
    
    <?php endif; ?>

    3. You can add this under Custom > CSS in the Customizer.

    
    .gtranslate div {
        display:inline-block;
    }

    Thanks

    #102922

    It works 🙂

    thanks alot – very great support youve got going here 🙂

    #102944

    Cousett
    Member

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

    #150970
    This reply has been marked as private.
    #151260

    Rad
    Moderator

    Hi there,

    Can’t check your site,

    1. The admin login has no permission to check and edit theme files.
    2. FTP isn’t working.

    Thanks.

    #633224

    Bim
    Participant

    What css tips can be used to have flags appear on a single line.

    http://quietlunch.com

    #633369

    Jade
    Moderator

    Hey Bim,

    You can increase the width of what’s currently in your CSS Customizer which is:

    #flags {
        width: 165px;
    }

    to something like:

    #flags {
        width: 50%;
    }

    Hope this helps.

    #636280

    Bim
    Participant

    Perfection! Thanks much!

    #636298

    Nico
    Moderator

    Glad to hear that. You’re welcome.

    Feel free to ask us again. Have a great day! 🙂

    #784149

    neilr2096
    Participant

    is this address correct: Paste the code below in /wp-content/themes/x-child-integrity-light/framework/views/global/_topbar.php

    as my box appears at the bottom of the page?