I have a plugin (Social Warfare) that I love. But, there's no widget available. What is involved in creating a widget so that I can use the shortcode that seems to work fine on the pages and posts?
2 Answers
You can add a Shortcode using the built-in text widget. To get the widget to process Shortcodes, add the following filter in your theme's functions.php
:
add_filter( 'widget_text', 'do_shortcode' );
This will result in widget text being passed thru do_shortcode
, which will render any Shortcodes embedded in the text. Just note that this may not work for all Shortcodes, depending on what it actually does and if it needs a specific context to work properly.