Use Shortcodes Within WordPress Text Widget

Some days ago I shared a tip on using PHP snippets within WordPress text Widgets. Here’s another equally handy snippet for using Shortcodes within WordPress text widget.

To allow shortcodes within WordPress text widgets, simply edit the functions.php file from your theme and add the following code

Shortcodes Within WordPress snippets

add_filter('widget_text', 'do_shortcode');

Once you saved the file, you can now add as many short codes as you want in sidebar widgets.

How to edit functions.php file?

If you do not know how to edit fuctions.php file Please follow below steps to edit WordPress functions.php file

  1. Log into your WordPress Dashboard
  2. Under “Appearance” click “Editor” (if you cant see this it might be disabled – if so contact the company who created your theme)
  3. In the list of files on the right of the page, click “functions.php”
  4. At the bottom of the functions.php file, add the above code

Masum Billah has written 326 articles

Hi I am Md. Masum Billah Contributor of this website. I always like to share various things with other. In this website I am sharing web design related tips and tricks, necessary web development tools, source codes for beginner and advance web developer. You may join with us to help other who want to learn web design and development. Thank you for stay with.

Recommended Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>