• Resolved acekin

    (@acekin)


    I have had a footer widget that displays a copyright notice. As part of that, I had the shortcode [footer_copyright] to add the current year. It stopped working for some reason and I am not exactly sure when. The same code displays the year fine in the site footer which is currently hidden.

    Has there been a change in Simple Edits that prevents it from executing the shortcode in the footer widget? I can of course remove the token and add the current year but am just curious.

    Site: http://www.keptlight.com

    Thanks

    Cemal

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Nick C

    (@modernnerd)

    Hi Cemal

    To get shortcodes to work in text widgets, you’ll need to add this line to your theme’s functions.php file:

    add_filter( 'widget_text', 'do_shortcode' );

    If your previous theme had this modification and you recently switched themes, that could explain why it’s stopped working.

    Thread Starter acekin

    (@acekin)

    Thank you Nick, I will check the functions file. I have been using the same theme for several years now, I’m not sure what caused the change. That said, what is the harm in adding this line in the functions.php file as a matter of course?

    I will try and post again to bring closure to the question. Thank you.

    Cemal

    Thread Starter acekin

    (@acekin)

    Back again, I added the line to the fucntions.php and lo and behold, the problem is fixed.

    Please do consider including this line in the functions.php file.

    Thank you again,

    Cemal

    Plugin Support Nick C

    (@modernnerd)

    Thanks for the update, Cemal.

    The theme doesn’t add the code by default because it can cause issues with plugins that don’t support use of shortcodes in widgets (if you see no issues, though, it’s fine to leave the code in place).

    Also, WordPress itself may add the filter so that shortcodes work in text widgets by default in a future release: https://core.trac.wordpress.org/ticket/10457

    Glad to hear it helped in this case, though!

    • This reply was modified 9 years, 3 months ago by Nick C.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Footer copyright shortcode in widget’ is closed to new replies.