Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #36287

    Carmine M
    Participant

    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.

    #36539

    Rad
    Moderator

    Hi 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

    #40195

    Carmine M
    Participant

    perfect.
    shouldn’t copyright date=current year be a theme option?

    #40274

    Rad
    Moderator

    Hi 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.

    #44030

    Carmine M
    Participant

    Fantastic 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

    #44368

    Alexander
    Keymaster

    Hi 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.

    #44402

    Carmine M
    Participant

    O’tay. Thanks.

    #44655

    Christian
    Moderator

    You’re welcome Carmine.

    #145690

    Carmine M
    Participant

    update 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

    #146059

    Christopher
    Moderator

    Carmine thank you for your contribution.

    #237156

    geekgoddess
    Participant

    Hi, 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. 🙂

    #237278

    Rue Nel
    Moderator

    Hello 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.

    #361250

    alistair
    Participant

    Is there an update on whether this will be included in the next release? It would be super useful.

    Thanks
    Alistair

    #361271

    Rupok
    Member

    Hello 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!

    #363547

    dmuller
    Participant

    If 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.