Quantcast
Viewing latest article 2
Browse Latest Browse All 12

How to enable Shortcodes in WordPress Widget Area

In previous article I showed How to execute PHP code in Text Widget without using Plugin and this post also deals with similar kind of stuffs.

Shortcodes are piece of reference code which executes specific set of codes when it called.Shortcodes are used it for reducing the code redundancy and to keep things simpler.

Shortcodes feature is implemented on WordPress 2.5.The catch is,shortcodes can be used anywhere inside the contents but not the Widget area.

Many WordPress plugins like YARP supports shortcodes feature but if you want to run these shortcodes in Widget areas like sidebar and footer then add the following line of code in your current theme’s function.php file.

add_filter('widget_text', 'do_shortcode');

Now save the file and To check the functionality add your custom shortcode in a text widget.

The post How to enable Shortcodes in WordPress Widget Area appeared first on WPstuffs.


Viewing latest article 2
Browse Latest Browse All 12

Trending Articles