-
AuthorPosts
-
April 23, 2014 at 9:25 am #36287
Hi,
I’m in the customizer adding info to the “Footer Content” field and want to add “Copyright [year] …” I’ve installed a plugin called “Extra Shortcodes” that will insert the current year. I’ve tested the shortcode on page content and widgets and it’s working fine.can you give me the function and file to put it in? I think that’s what I need.
April 23, 2014 at 8:25 pm #36539Hi Carmine,
Thank you for writing in! You could duplicate your /x/framework/views/{YOUR STACK}/wp-footer.php in to your child theme (eg. /x-child-{YOUR STACK}/framework/views/{YOUR STACK}/wp-footer.php).
Then find this line :
<?php echo get_theme_mod( 'x_footer_content' ); ?>
And change it into :
<?php echo do_shortcode(get_theme_mod( 'x_footer_content' )); ?>
Hope this helps
May 3, 2014 at 5:10 pm #40195perfect.
shouldn’t copyright date=current year be a theme option?May 3, 2014 at 10:08 pm #40274Hi Carmine,
Yes, that would be nice. But as of now, you could only add copyright text manually in customizer’s footer content.
Though, since we already setup a shortcode for your footer, then you could add this code at your child theme’s functions.php.
add_shortcode('x-copyright-year', 'x_copyright_year'); function x_copyright_year($a) { return date('Y'); }
Then, you could use [x-copyright-year] shortcode at your footer text to display the year.
Hope this helps.
May 13, 2014 at 3:01 pm #44030Fantastic and worked great. Now I’m having the same issue with sidebars / widgets won’t accept shortcodes OR UL/LI’s. Can you assist?
With Best Regards,
-carmine
May 14, 2014 at 12:30 pm #44368Hi Carmine,
WordPress doesn’t intend for shortcodes to be used within widgets. I’m afraid we don’t have a feature to enable it, as it’s not recommended. A customization for this is something that would fall outside the scope of our support. You could look into a plugin that enables this for you, or consult with a developer.
May 14, 2014 at 2:30 pm #44402O’tay. Thanks.
May 15, 2014 at 3:10 am #44655You’re welcome Carmine.
November 15, 2014 at 10:05 am #145690update for the folks.
when I updated to x3 I noticed a slight change. So if anyone want this feature to work they now should be looking for this code…
<?php echo x_get_option( 'x_footer_content' ); ?>
instead of this code…
<?php echo get_theme_mod( 'x_footer_content' ); ?>
and it would be changed to this code…
<?php echo do_shortcode(x_get_option( 'x_footer_content' )); ?>
OK GooGoo?
With Best Regards,
-carmine
November 16, 2014 at 5:23 am #146059Carmine thank you for your contribution.
March 28, 2015 at 2:42 pm #237156Hi, I had to do this search also. I’m not too keen on editing a theme file since any change you make to X wouldn’t be reflected unless I kept copying the new wp-footer.php file over. Any chance you would make this code standard so people can insert shortcodes there? That way we’re only editing our child theme files. 🙂
March 28, 2015 at 11:52 pm #237278Hello There,
We already sent this request to our developers to make it as a standard that you can insert a shortcode inside the footer content. This might be included in the next release update.
Thanks for understanding.
August 17, 2015 at 10:15 am #361250Is there an update on whether this will be included in the next release? It would be super useful.
Thanks
AlistairAugust 17, 2015 at 10:51 am #361271Hello Alistair,
We can’t give you any ETA for this but we have already forwarded that to our developers. They will decide whether it should be added or not. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive. Thanks!
August 19, 2015 at 11:59 am #363547If I may chime in here… this would be a VERY useful addition to X. The current footer is extremely limited in functionality. Oftentimes a client will want several key bits of information in the footer, to have them as a single line is possible but it will break horribly on mobile and tablet.
Thanks,
David.
-
AuthorPosts