Getting gTranslate shortcode on the navbar for the X theme

I need help getting the gTranslate shortcode on the navbar.

I tried modyfing my child theme functions.php adding <?php echo do_shortcode('[gtranslate]'); ?> at the end but I broke the site with that change. I was able to restore it removing that line. What;s the best way for to get this working right?

// Additional Functions
// =============================================================================

// Add text next to the logo
// =============================================================================
function add_logo_text_number(){ ?>
  
  <div class="custom-text left pas">
    <span class="logo-text"><a href="https://afuego.us">AFUEGO</a></span>
  </div>

<?php }
add_action('x_after_view_global__brand', 'add_logo_text_number');
// =============================================================================

<?php echo do_shortcode('[gtranslate]'); ?>

Thank You!

Hey @jpandino,

Try putting your do shortcode line inside your function like this.

function add_logo_text_number() { ?>
  
  <div class="custom-text left pas">
    <span class="logo-text"><a href="https://afuego.us">AFUEGO</a></span>
  </div>

<?php echo do_shortcode('[gtranslate]'); }

Thanks.

1 Like

it works but doesn’t get aligned with the logo text.

Hello @jpandino,

Thanks for updating thread. :slight_smile:

Can you please share website URL for us to take a closer look?

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.