1

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 2

0

You can find more information in the Widgets API

1

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.

1
  • Worked like a champ !!
    – PjGermain
    Apr 8, 2016 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.