-
AuthorPosts
-
January 18, 2015 at 10:48 am #185588
Hello. Can shortcode work in X top bar now? I recall at first it could not, but maybe with the new updates you have made those possible… 🙂 Just wanted to add a shortcode in the top bar…
Thanks!
January 19, 2015 at 5:09 am #186033Hi there,
Thanks for writing in! Because this requires a template change, 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.
Then you can copy the file “_topbar.php” file into your Child Theme and Edit the file using a Text Editor and add the shortcode as follows below the line
<p class="p-info">
.<?php echo do_shortcode('[SHORTCODE-HERE]'); ?>
Hope that helps.
January 21, 2015 at 2:56 pm #188342Alright. I will try that… Thanks!!!! 🙂
January 21, 2015 at 6:55 pm #188571Hello, what should be the path of the file in the child theme? >>>>>>>
I tried the following and it didn’t work… CHILD THEME/framework/views/global/_topbar.php
========================= CONTENT ===============================
<?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-fluid max width”>
<?php if ( x_get_option( ‘x_topbar_content’ ) != ” ) : ?>
<p class=”p-info”><?php echo
<?php echo do_shortcode(‘[SHORTCODE-HERE]’); ?>
x_get_option( ‘x_topbar_content’ ); ?></p>
<?php endif; ?>
<?php x_social_global(); ?>
</div>
</div><?php endif; ?>
Thanks!
January 22, 2015 at 12:34 am #188750Hi William,
Path should be wp-content/themes/x-child-integrity-light/framework/views/global/_topbar.php
If that doesn’t help, 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
January 23, 2015 at 11:25 pm #190602Hello,
I’m just thinking maybe the older way you suggested is conflicting with the new way you’re suggesting…
Sometime ago you suggested adding the code below in functions.php
======================================================
add_filter(‘theme_mod_x_topbar_content’,’x_topbar_do_shortcode’);
function x_topbar_do_shortcode($content) {
return do_shortcode( $content );
}January 25, 2015 at 6:06 am #191097Hi there,
Create _topbar.php file under YOUR CHILD THEME -> framework -> views -> global and add this code in there:
<?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' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php echo do_shortcode('[SHORTCODE-HERE]'); ?> <?php endif; ?> <?php x_social_global(); ?> </div> </div> <?php endif; ?>
Now instead of
[SHORTCODE-HERE]
put your shortcode in code above.Thank you.
July 22, 2015 at 6:06 pm #337475Hi, I’ve just tried this on my own site for the Subscribe2 plugin (the shortcode is [subscribe2]), and it’s not working. The URL is http://http://109.199.101.20/~efcnetwo/
Here’s the code I put into the copy of _topbar.php that I put into /public_html/wp-content/themes/x-child/framework/views/global:
<?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' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php echo do_shortcode('[subscribe2]'); ?> <?php endif; ?> <?php x_social_global(); ?> </div> </div> <?php endif; ?>
July 22, 2015 at 6:11 pm #337485This reply has been marked as private.July 22, 2015 at 9:05 pm #337640Hello There,
Upon checking your site, the form is being displayed by given code already. The code seems to be enclosed with an html comment and that is why it is not showing in the front end. You can check it by viewing the source code of the page. http://prntscr.com/7vw2v3
Please check your subscribe 2 shortcode being displayed. It may sounds like you might be having an issue with a third party plugin or script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.
Thank you for your understanding.
October 29, 2015 at 11:28 am #644935Hi Staff I have a question regarding this topic.
I’m trying to add this shortcode [periscope_on_air username=”jwiproperties” size=”small”] to the topbar so my client can display the Twitter Periscope on air button.
I’ve search all the threads regarding this topic but have yet to find a solution.
I’ve already tried adding the following to the child themes _topbar.php file.
.
<?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' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php echo do_shortcode('[periscope_on_air username=”jwiproperties” size=”large”]'); ?> <?php endif; ?> <?php x_social_global(); ?> </div> </div> <?php endif; ?>
Any suggestions would be highly valued.
Thanks for your time in advance,
FishOctober 29, 2015 at 3:21 pm #645299Hi Fish,
Can you try to use this code instead:
<?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' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php echo do_shortcode('[periscope_on_air username="jwiproperties" size="large"]'); ?> <?php endif; ?> <?php x_social_global(); ?> </div> </div> <?php endif; ?>
The only different is the character used in the shortcode
"
instead of”
.I am not certain if it’s because of an incompatibility in plugin but in case the first suggestion wouldn’t work kindly provide us with your FTP details so we can check it. Thank you.
October 29, 2015 at 5:12 pm #645407This reply has been marked as private.October 29, 2015 at 10:04 pm #645676Hello Fish,
We have tried to login to your ftp. The directory is empty. Would you also provide us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
To do this, you can make a post with the following info:
– Link to your site

– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
October 30, 2015 at 7:51 am #646215This reply has been marked as private. -
AuthorPosts