{"id":54327,"date":"2011-08-01T16:31:37","date_gmt":"2011-08-01T20:31:37","guid":{"rendered":"http:\/\/wpmu.org\/?p=54327"},"modified":"2013-06-13T21:02:34","modified_gmt":"2013-06-14T01:02:34","slug":"daily-tip-how-to-use-shortcodes-in-wordpress-text-widgets","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-use-shortcodes-in-wordpress-text-widgets\/","title":{"rendered":"How to Use Shortcodes in WordPress Text Widgets"},"content":{"rendered":"<p>Quite awhile ago I shared a tip on <a href=\"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-use-a-wordpress-shortcode-outside-of-the-post-editor\/\" target=\"_blank\">using shortcodes outside of the post editor<\/a>. Here&#8217;s another equally handy snippet for enabling shortcode use within WordPress text widgets.<\/p>\n<p>Add this to your <i>functions.php<\/i> file:<br \/>\n{code type=php}<br \/>\nadd_filter( &#8216;widget_text&#8217;, &#8216;shortcode_unautop&#8217;);<br \/>\nadd_filter( &#8216;widget_text&#8217;, &#8216;do_shortcode&#8217;);<br \/>\n<\/code><\/p>\n<p style=\"font-size: 11px;\">Source: <a href=\"http:\/\/sillybean.net\/2010\/02\/using-shortcodes-everywhere\/\" target=\"_blank\">using shortcodes everywhere<\/a><\/p>\n<p>Now you&#8217;ll be able to use shortcodes within text widgets, just as you would within the post editor.  Follow Stephanie Leary&#8217;s <a href=\"http:\/\/sillybean.net\/2010\/02\/using-shortcodes-everywhere\/\" target=\"_blank\">tutorial<\/a> to add shortcodes virtually anywhere you want within WordPress.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Grab this quick hack that lets you use shortcodes within text widgets, just as you would within the post editor.<\/p>\n","protected":false},"author":4099,"featured_media":54337,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[1081,52],"tutorials_categories":[],"class_list":["post-54327","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-shortcodes","tag-widgets"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/54327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=54327"}],"version-history":[{"count":0,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/54327\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/54337"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=54327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=54327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=54327"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=54327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}