{"id":2203,"date":"2017-08-08T00:04:42","date_gmt":"2017-08-07T22:04:42","guid":{"rendered":"https:\/\/www.axew3.com\/w3\/?p=2203"},"modified":"2024-09-29T08:24:30","modified_gmt":"2024-09-29T06:24:30","slug":"wordpress-shortcode-for-comments-widgets-and-excerpts","status":"publish","type":"post","link":"https:\/\/www.axew3.com\/w3\/2017\/08\/wordpress-shortcode-for-comments-widgets-and-excerpts\/","title":{"rendered":"WordPress shortcode for comments, widgets and excerpts"},"content":{"rendered":"<p>The following <strong><em>add_filter <\/em><\/strong>lines of code that will activate shortcode for Posts Comments, Widgets and Excerpts in WordPress, could also be added into your theme <em><strong>functions.php<\/strong><\/em> file.<\/p>\n<p>Or if you wish, you can add it on WP_w3all plugin (that allow you to <a href=\"https:\/\/www.axew3.com\/w3\/2017\/07\/wordpress-shortcode-phpbb-posts-into-wp-post\/\">show phpBB posts into WordPress<\/a>) inside the <strong><em>wp_w3all.php<\/em><\/strong> file <em>(NOTE: when plugin update you&#8217;ll lost these modifications).<\/em><\/p>\n<p>Open <strong><em>wp_w3all.php<\/em><\/strong> and search for line:<\/p>\n<pre class=\"lang:default decode:true \">add_shortcode( 'w3allforumpost', array( 'WP_w3all_phpbb', 'wp_w3all_get_phpbb_post' ) );<\/pre>\n<p>immediately after, add the follow line\/s, about what\/where you want to activate shortcode<\/p>\n<p><strong>Activate shortcode for Posts Comments:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">add_filter( 'comment_text', 'do_shortcode' );<\/pre>\n<p><strong>Activate shortcode for Widgets:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">add_filter( 'widget_text', 'do_shortcode' );<\/pre>\n<p><strong>Activate shortcode for Excerpt:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">add_filter( 'the_excerpt', 'do_shortcode');<\/pre>\n<p>As said above, you could instead add these &#8220;activation&#8221; code lines for shortcode in Posts Comments, Widgets or Excerpts in WordPress, into the <strong><em>functions.php<\/em><\/strong> file of your WordPress theme.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following add_filter lines of code that will activate shortcode for Posts Comments, Widgets and Excerpts in WordPress, could also be added into your theme functions.php file. Or if you wish, you can add it on WP_w3all plugin (that allow you to show phpBB posts into WordPress) inside the wp_w3all.php file (NOTE: when plugin update [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[147,144,146,97,142,145,41],"class_list":["post-2203","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-add","tag-comments","tag-excerpts","tag-how-to","tag-shortcode","tag-widgets","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts\/2203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/comments?post=2203"}],"version-history":[{"count":2,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts\/2203\/revisions"}],"predecessor-version":[{"id":2540,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts\/2203\/revisions\/2540"}],"wp:attachment":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/media?parent=2203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/categories?post=2203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/tags?post=2203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}