Title: Allow shortcode in customizer?
Last modified: June 16, 2021

---

# Allow shortcode in customizer?

 *  Resolved [Jason Rouet](https://wordpress.org/support/users/jaz_on/)
 * (@jaz_on)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/allow-shortcode-in-customizer/)
 * Hello there,
    I’m playing with twentig and I must admit that it is a delight 
   to work with!
 * I’m stuck on something secondary but that would be practical: I’m trying to add
   a widget via the customizer in order to edit the footer (via the personnalized
   credit field).
 * I try adding this but it is not showing in front-end:
 * `<?php echo do_shortcode(" [shortcode]"); ?>`
 * The shortcode is working elsewere on the website but I think the customizer doesn’t
   like it…
 * Did you guy’s have a way to make it work?
 * Thanks,
    Jason

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Twentig](https://wordpress.org/support/users/twentig/)
 * (@twentig)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/allow-shortcode-in-customizer/#post-14582583)
 * Hi Jason,
 * Thanks for your kind words.
 * We’ll add the feature to display the shortcodes pasted in the credit field in
   the next release. If you need to fix it urgently and you’re comfortable editing
   the plugin file, I can give you the PHP code to modify. Just let me know which
   theme you’re using (Twenty Twenty-One or Twenty Twenty).
 * Have a nice day,
    Tom
 *  Thread Starter [Jason Rouet](https://wordpress.org/support/users/jaz_on/)
 * (@jaz_on)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/allow-shortcode-in-customizer/#post-14582627)
 * Hi Tom (@twentig),
 * Thanks for your quick response and the addition of this feature in the next update.
   
   I am using the twenty-one theme and I will add the PHP code you’ll give me while
   waiting for the update. =)
 * Regards,
    Jason
 *  Plugin Author [Twentig](https://wordpress.org/support/users/twentig/)
 * (@twentig)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/allow-shortcode-in-customizer/#post-14582724)
 * Inside the wp-content/plugins repository, open the twentig/inc/twentytwentyone/
   footer.php file.
 * Line 214, replace:
    `<?php echo wp_kses_post( str_replace( '[Y]', date_i18n( '
   Y' ), $credit_text ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?
   >`
 * by
    `<?php echo do_shortcode( wp_kses_post( str_replace( '[Y]', date_i18n( 'Y'),
   $credit_text ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?
   >`
 * Thanks for the review 🙂
 *  Thread Starter [Jason Rouet](https://wordpress.org/support/users/jaz_on/)
 * (@jaz_on)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/allow-shortcode-in-customizer/#post-14584232)
 * Nice! It works like a charm! 👌

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Allow shortcode in customizer?’ is closed to new replies.

 * ![](https://ps.w.org/twentig/assets/icon.svg?rev=2569439)
 * [Twentig Supercharged Block Editor – Blocks, Patterns, Starter Sites, Portfolio](https://wordpress.org/plugins/twentig/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/twentig/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/twentig/)
 * [Active Topics](https://wordpress.org/support/plugin/twentig/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/twentig/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/twentig/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jason Rouet](https://wordpress.org/support/users/jaz_on/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/allow-shortcode-in-customizer/#post-14584232)
 * Status: resolved