I've been stuck on this for a while. I'm working on a wordpress site where I wrote the theme from scratch, I use php calls to get the wordpress functionality that I need in certain sections.
I'm trying to use a plugin, but calling it via
echo do_shortcode('[STORE-LOCATOR]');
just isnt working. Even when I switch to the default template and post that code, it still doesnt work. It simply echoes "[STORE-LOCATOR]"
Any help would be greatly appreciated.
Check whether the plugin providing the shortcode is active or not. If it is not active, then the shortcode won't work. 2. Your theme is outputting the post content without applying the needed filters to it.
The WordPress do_shortcode function makes it easy to include shortcodes directly in your theme's template files. All you need to do is include the shortcode inside of the do_shortcode function and echo the function in the template location where you want the shortcode to appear.
Press the brackets icon to display the shortcode. Then, copy the shortcode, as you'll need it later. Go to Appearance -> Customize, to go to the Customizer and insert the custom HTML in the page you want. Create a new section that will be dedicated to the custom HTML you want to insert in the page.
[STORE-LOCATOR]
is probably not a 'shortcode' in WordPress sense.
I encountered this on different plugin, Stream media player. They use the same syntax as shortcodes, but they are actually not.
Try using:
echo apply_filters( 'the_content',' [STORE-LOCATOR] ');
instead of do_shortcode
, and see if it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With