Using a shortcode in SiteOrigin Hero
I am using the SiteOrigin Hero Widget. Inside of the frame, I would like to use a shortcode of my own plugin:
<p style="text-align: center;">[my_shortcode]
But it only displays
[my_shortcode]
I tried enabling the shortcode for widgets by calling
add_filter('widget_text', 'do_shortcode');in my plugin and it works for usual WP widgets, but not inside of the SiteOrigin Hero widget. What can I do to make it work?
Thanks in advance,
Kilian
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
3Hi Kilian,
That’s odd. Shortcodes should be working without issue. Can you please send me a copy of your shortcode so I can run some tests?
Hi Alex, thank you for your response. I reproduced the issue with a simple plugin:
These are the steps to reproduce it:
– Install WordPress 4.8.2 with the default Twenty Seventeen theme
– Install and activate the current SiteOrigin Widgets Bundle Plugin (1.10.2)
– Activate the my-plugin.php plugin (code above)
– Add the SiteOrigin Hero widget to the sidebar with [my_shortcode] in the frame
– Add a text widget to the sidebar with [my_shortcode] as text
This is the resulting sidebar:
Hi Kilian,
I just double checked the code and I’m mistaken.
Unfortunately, shortcodes intentionally don’t currently work with the SiteOrighn Hero widget. I’m going to log this as a feature request but in the meantime, I recommend using the SiteOrigin Layout Slider instead. Can’t see this widget? You can activate it by navigating to WP AdminPluginsSiteOrigrn Widgets.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.