Enabling Shortcodes for X Theme Top Bar

By default the X Theme does not include shortcode support for their topbar display element. In order to add shortcode support, you need to create a child theme, and place this new code in the _topbar.php file. This fix isn’t Memberium specific and will enable all shortcodes for the top bar.

Hat tip to John Cook for the code snippet.

<?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' ) != '' ) : ?> 
<?php $get_topbar_content = x_get_option( 'x_topbar_content' ); ?> 
<p class="p-info"><?php echo do_shortcode($get_topbar_content); ?></p> 
<?php endif; ?> 
<?php x_social_global(); ?> 
</div> 
</div>

<?php endif; ?>
  • Was this Helpful?
  • YesNo
9 ways to add more value to your membership site

Table of Contents

Keep Reading

Site Lock

This setting requires that the user be logged in prior to viewing any pages on the site. Any attempt to view any page without being logged in, will cause the user to be redirected to the login page.

Read More »

Want to get some fresh ideas on how you can improve your membership site or course?

Download our free ebook!

Book a Call

Welcome to Memberium!

We are very excited for you to be part of our family. 

We would love to answer any questions that you have!

Please choose the best time for you to get in a call with us. 

For Technical Support, you can contact us at https://keap.memberium.com/support/ or Email us at support@memberium.com.