Tagged: archive, description, enfold, settings, shortcode, woocommerce
I have WooCommerce installed and use the shop description from the settings within the theme options. I need to place a [shortcode] inside the description but it is not being executed.
For the product categories (they share the same layout as the shop description) I use this code inside my functions.php to make shortcodes work:
add_filter( 'product_cat_description', 'do_shortcode' );
What is the correct filter to enable shortcodes for the shop description as well? Any help is appreciated. Thanks!
Hey Daniel,
I didn’t find a filter for this, but I asked the team for advice. Thank you for your patience.
Best regards,
Mike
Hi Mike, thank you for the short response. I still need to enable shortcodes in the shop description. Any idea on when you will have a solution for me?
Hey,
Currently, there isn’t a filter for this. I’ll submit this as a feature request.
For now, please go to the enfold/config-woocommerce/ folder, open the config.php file, and find the following line:
$output .= "<{$desc_tag} class='av-banner-description'>{$description}</{$desc_tag}>";
and change it to the following:
$output .= "<{$desc_tag} class='av-banner-description'>" . do_shortcode($description) . "</{$desc_tag}>";
Best regards,
Yigit
Hi Yigit, thank you for the workaround! How is the roadmap for integrating the filter for this? Will anyone post here once it is shipped or will I find it in the changelog? And: Can I make your suggested change in a child theme?
Hey,
This exact solution will be included in the upcoming version so you can apply it to the parent theme for now.
You can find this noted in the Upcoming Fixes thread: https://kriesi.at/support/topic/enfold-upcoming-fixes/
Regards,
Yigit
Nice! Thanks a lot. You may close this.
All the best,
Daniel