Thursday, December 16, 2010

Snippet: How to Enable Shortcode in Widget

The best way to implement php code in the widget is via the use of shortcode. The following line of code is all you need to enable the shortcode for widget function.

In your functions.php file, paste the following:
[php]add_filter('widget_text', 'do_shortcode');[/php]

That's it.

No comments:

Post a Comment