• Resolved Jason Rouet

    (@jaz_on)


    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

    (@twentig)

    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

    (@jaz_on)

    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

    (@twentig)

    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

    (@jaz_on)

    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.