Add text with links to the horizontal middle of the Topbar

Hi!

How are you?

I looked in the forum but could not find a solution, so here is my question: How can I add a short text to the horizontal middle of the TOPBAR on the same vertical level as the social icons?

I want to add the text below with a specific html link for each language

FR | EN | ES

FR: https://fr.brand.com
EN: https://brand.com
ES: https://es.brand.com

Please find a visual example below, the green square is just to get your focus on the desired area.

Our current TOBAR html code contains ("." excluded.):

.
+33 9 70 44 77 27‬ | Skype
.

Hi @VSTars,

Thanks for reaching out.

That’s not currently possible with the current topbar structure, I recommend using Pro when creating custom headers. Or, you can customize your topbar’s template. Please check this https://theme.co/apex/forum/t/how-to-upload-xtheme-to-child-theme/43246 of how you can edit the topbar template. And you’ll be working on framework/legacy/cranium/headers/views/global/_topbar.php

Then simply create your topbar within the global block (contact, language link, and social icons), please check this https://theme.co/apex/forum/t/global-blocks/24723

Then edit your _topbar.php and replace the content with this along with your global block’s shortcode.

<?php

// =============================================================================
// VIEWS/GLOBAL/_TOPBAR.PHP
// -----------------------------------------------------------------------------
// Includes topbar output.
// =============================================================================

?>

<?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>

<?php echo do_shortcode('[cs_gb id=381]'); ?>

<?php endif; ?>

I only added [cs_gb id=381] as a sample, please add your own global block shortcode.

Thanks!

Hi,

You totally lost me here. I do not understand what to do. Our website already uses the X childtheme. As for Pro, our team has used it and said they really preferred X. So we do not want to shift to pro just for this.

We’re trying something else, but I am still interested to know about your option.

Hi,

Since your site is using X already, you need to customize your topbar’s template.

Please do the following.

  1. Create your topbar in Global Blocks(its easier this way), three columns then add text elements on first and second columns and social elements on the third column.
  1. Create file _topbar.php in your computer
  2. Paste the code below into that file.
<?php

// =============================================================================
// VIEWS/GLOBAL/_TOPBAR.PHP
// -----------------------------------------------------------------------------
// Includes topbar output.
// =============================================================================

?>

<?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?>

<?php echo do_shortcode('[cs_gb id=381]'); ?>

<?php endif; ?>

Change [cs_gb id=381] with your global block shortcode

  1. Login to ftp and upload _topbar.php to wp-content\themes\x-child\framework\legacy\cranium\headers\views\global

Hope this helps

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