As the rather long winded title suggests, I was recently updating my Colormag theme (from Theme Grill) and after enabling the option to remove the front page and just use widgets, the woocommerce [recent_products] and [categories] shortcodes stopped working.
After digging around it was apparent that the woocommerce shortcodes (and indeed all others) simply don’t work in widgets!
It’s very useful for your colormag theme if using widgets on the front page. For example, on my Christmas Jumpers website, the front page looked like this (highlighted is the shortcode I wanted to use in the Top Section widget area).
How do I get wordpress shortcodes to work in my widget?
Luckily, it’s just one line of code to enable shortcodes in your widgets. You need to edit functions.php. If you’re not sure how to do this, check out a few guides on how to create a child theme. You don’t really want to be edited the main theme as future theme updates would wipe out your code.
Open functions.php in the wordpress admin (Appearance > Editor). At the bottom of the file (making sure it’s before the ?> tag if that exists).
Save the functions.php file. Now refresh your page and it should show the shortcode working (as seen below).