Topbar content

Hello, X-Masters!

Please help me to add shortcode [x_text_type] to TopBar.

I would like to show a message to my users in TopBar zone.

I want to add this shortcode:

[x_text_type prefix=“This is the " strings=“first string|second string|third string” suffix=” of the sentence." tag=“h3” type_speed=“50” start_delay=“0” back_speed=“50” back_delay=“3000” loop=“true” show_cursor=“true” cursor="|" looks_like=“h3” class=“cs-ta-center”]

but it is not work at TopBar…

Thank you for an advices.

Hi there,

Please install and activate the child theme and add this code in the functions.php:

add_filter('x_option_x_topbar_content', 'top_bar_content_shortcode');

function top_bar_content_shortcode ( $content ) {
    return do_shortcode ( $content );
}

Hope this helps.

Your advice is working nice!

:slight_smile:

Thank you.

You’re most welcome. :slight_smile:

Where do I add the actual shortcode to the topbar? I’ve added the above code to my child theme’s functions.php , but now want to add my [s2member_pro_login_widget] shortcode to the topbar, right of the social media icons. I am using the Ethos stack.

baril.co

Thanks in advance!

Hi there,

Please add it in X > Launch > Options > Header > Topbar > Topbar Content.

Hope this helps.

HI, all!

What about one more difficult? :thinking:

The top bar.
The left side has text (exemple - working time :speech_balloon: ).
The right side has another info (exemple - tel. number :telephone_receiver: ).

And all sides - in one line.

How I can do it? :roll_eyes:

Hi there,

Try wrapping the left and right content in a separate span text and specify a class to each span wrapper. You can then position them to the left and right using a custom CSS.

Hope this helps.

Hi and thank you for advice.

I can add <*left> or <*right> but the texts will be in different lines (the left is lowly the right).

I would like wrote it in the one line: a part to left and another part to right side.

Hi there,

Please try this content on the topbar:

<span class="left">
    The left content here.
</span>
<span class="right">
    The right content here.
</span>

Then add this in the custom CSS:

.p-info .left {
    display: inline-block;
    float: left;    
}

.p-info .right {
    display: inline-block;
    float: right;    
}

Hope this helps.

Thank you. I will try it.

Sure, do let us know how this goes!

Does not work. I’m go out of this way and go another path…

Sure, do let us know if you need any assistance.

Thanks!

For simplicity use the “do_shortcode” function directly. This saves you some lines of code and a bit of performance.

add_filter('x_option_x_topbar_content', 'do_shortcode');

Hi @TheOwnplay,

Thank you for sharing with us.

Have a nice day!

Thank you.

You’re welcome.

This didn’t work for me. Site URL is http://www.singh-ray-usa.com.
It’s displaying the short code like text instead of executing it. Any ideas?

Hi there,

Please create your own thread with describing your issues.

Thanks.