{"id":35951,"date":"2010-07-26T14:00:19","date_gmt":"2010-07-26T18:00:19","guid":{"rendered":"http:\/\/wpmu.org\/?p=35951"},"modified":"2012-10-12T14:33:40","modified_gmt":"2012-10-12T18:33:40","slug":"daily-tip-how-to-use-a-wordpress-shortcode-outside-of-the-post-editor","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-how-to-use-a-wordpress-shortcode-outside-of-the-post-editor\/","title":{"rendered":"How to Use a WordPress Shortcode Outside of the Post Editor"},"content":{"rendered":"<p>Here&#8217;s a handy tip from the codex. If you want to use a shortcode outside of the WordPress post or page editor, you can use this snippet to output from the shortcode&#8217;s handler(s):<\/p>\n<pre>\/\/ Use shortcode in a PHP file (outside the post editor).\r\n&lt;?php echo do_shortcode('\r\n[shortcode]\r\n'); ?&gt;<\/pre>\n<p>Replace<\/p>\n<p><code>[shortcode]<\/code><\/p>\n<p>with the shortcode you want to use. More information is available in the WordPress codex on the <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/do_shortcode\" rel=\"noopener\" target=\"_blank\">do_shortcode function<\/a> page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a handy tip from the codex. If you want to use a shortcode outside of the WordPress post or page editor, you can use this snippet to output from the shortcode&#8217;s handler(s): \/\/ Use shortcode in a PHP file (outside the post editor). &lt;?php echo do_shortcode(&#8216; [shortcode] &#8216;); ?&gt; Replace [shortcode] with the shortcode [&hellip;]<\/p>\n","protected":false},"author":4099,"featured_media":0,"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":[1,557,235,1117,4],"tags":[390,1081],"tutorials_categories":[],"class_list":["post-35951","post","type-post","status-publish","format-standard","hentry","category-news-community","category-development","category-misc","category-multisite","category-plugins","tag-code","tag-shortcodes"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/35951","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=35951"}],"version-history":[{"count":7,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/35951\/revisions"}],"predecessor-version":[{"id":183059,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/35951\/revisions\/183059"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=35951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=35951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=35951"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=35951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}