-
AuthorPosts
-
June 27, 2018 at 11:17 pm #978604
I’m trying to add an Icon List to the WooCommerce shop category descriptions. I found a post with some instructions for another theme (https://kriesi.at/support/topic/shortcodes-not-working-in-product-short-description-area/), but /config-woocommerce/config.php must have changed considerably since then. I’ve tried adding filters, but they don’t seem to be executed, so I need some guidance on how to get this to work. The top of the page I’m working on has the icon lists the way I want, but not in WooCommerce, and the bottom of the page contains a [product_categories] shortcode which is spitting out the shortcodes from the category descriptions without evaluation.
Thanks!
June 29, 2018 at 12:29 pm #979315Hey Lissasan,
Thank you for using Enfold.
How did you manage to display the product category description? Did you edit any files? The description should not be displaying by default.
Best regards,
IsmaelJune 29, 2018 at 8:56 pm #979468Hi Ismael,
Yes, I added the code described on this page at StackOverflow (https://stackoverflow.com/questions/46885808/file-wc-template-functions-php-in-child-theme), plus my modification to print out the description under the <h2> element, which is the item count for the category. The code isecho $category->descriptioninside paragraph tags.I added this to my child theme functions.php file.
-
This reply was modified 7 years, 4 months ago by
Lissasan. Reason: Changed StackExchange to StackOverflow for clarity
June 30, 2018 at 9:37 am #979569Hi,
Please try to replace:
echo $category->descriptionwith:
echo do_shortcode($category->description);to execute shortcodes which are embedded in the description text.
Reference: https://developer.wordpress.org/reference/functions/do_shortcode/Best regards,
DudeAugust 24, 2018 at 8:44 pm #1001395This worked! Thank you so much! This can be marked as resolved.
August 25, 2018 at 8:38 am #1001528Hi,
Great, glad it works now :)
Best regards,
Dude -
This reply was modified 7 years, 4 months ago by
-
AuthorPosts
- The topic ‘Shortcodes in WooCommerce Category Description’ is closed to new replies.
