{"id":2064,"date":"2023-12-10T11:28:16","date_gmt":"2023-12-10T11:28:16","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=2064"},"modified":"2023-12-10T11:28:16","modified_gmt":"2023-12-10T11:28:16","slug":"better-recent-comments","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/better-recent-comments\/","title":{"rendered":"Better Recent Comments Shortcode"},"content":{"rendered":"\n        \n        <p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Better Recent Comments Shortcode<\/strong> to your WordPress website, including its <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Better Recent Comments Plugin shortcode not to show or not to work correctly.<\/p>\n        \n\n        \n        <p class=\"wp-block-paragraph\">Before starting, here is an overview of the Better Recent Comments Plugin and the shortcodes it provides:<\/p>\n        \n        \n        <p>            <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/better-recent-comments\/assets\/icon-128x128.png?rev=2771699\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/better-recent-comments\" target=\"_blank\" rel=\"noopener\">\n                        Better Recent Comments                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Better Recent Comments is a user-friendly WordPress plugin that enhances the visibility of the latest comments on your blog, improving engagement and interaction.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2606<\/span> (17)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 3000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: 7.1            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[better_recent_comments]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n            <div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n            \n            \n            <h2 class=\"wp-block-heading\">Better Recent Comments [better_recent_comments] Shortcode<\/h2>\n            \n            \n            \n            <p class=\"wp-block-paragraph\">The Better Recent Comments plugin shortcode is a powerful tool for displaying recent comments. It utilizes the shortcode function to fetch and display the most recent comments based on the specified attributes.\n\n \n\nThis shortcode retrieves the default arguments, processes them, and returns the recent comments. This allows for easy and flexible customization of your recent comments display.<\/p>\n            \n\n            \n            <p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[better_recent_comments]<\/code><\/p>\n            \n            \n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n                <h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n                \n \n            <p><strong>Basic example<\/strong> &#8211; The shortcode displays the recent comments on the website using default parameters.<\/p>\n\n<pre class=\"wp-block-code\"><code>[better-recent-comments]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n\n<p>Display the recent comments with a specific number of comments and order. The &#8216;number&#8217; attribute controls the number of comments to show, and the &#8216;order&#8217; attribute controls the order of comments. &#8216;ASC&#8217; for ascending order and &#8216;DESC&#8217; for descending order.<\/p>\n\n<pre class=\"wp-block-code\"><code>[better-recent-comments number=\"5\" order=\"ASC\"]<\/code><\/pre>\n\n\n<p>Display the recent comments excluding certain users. The &#8216;exclude_users&#8217; attribute allows you to exclude comments from specific users by their IDs.<\/p>\n\n<pre class=\"wp-block-code\"><code>[better-recent-comments exclude_users=\"2,3\"]<\/code><\/pre>\n\n\n<p>Display the recent comments from a specific post. The &#8216;post_id&#8217; attribute allows you to display comments from a specific post by its ID.<\/p>\n\n<pre class=\"wp-block-code\"><code>[better-recent-comments post_id=\"10\"]<\/code><\/pre>\n\n\n<p>Combine multiple attributes to display recent comments in a specific way. In this example, we display 5 recent comments in ascending order, excluding users with IDs 2 and 3, from post with ID 10.<\/p>\n\n<pre class=\"wp-block-code\"><code>[better-recent-comments number=\"5\" order=\"ASC\" exclude_users=\"2,3\" post_id=\"10\"]<\/code><\/pre>\n\n\n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n            <h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n            \n            \n            \n            <p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[better_recent_comments]<\/code> shortcode, check below the related PHP functions code.<\/p>\n            \n                    \n                    <p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n                    \n        \n                    \n                    <pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( self::SHORTCODE, [ $this, 'shortcode' ] );<\/code><\/pre>\n                    \n                    \n                    <p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n                    \n            \n                    <div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n                    function shortcode( $atts, $content = &#039;&#039; ) {\n\t\t$atts = shortcode_atts( Util::default_shortcode_args(), $atts, self::SHORTCODE );\n\t\treturn Util::get_recent_comments( $atts );\n\t}\n                    <\/pre><\/div>\n                    \n                    <p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n                    \n                    \n                    \n                    <pre class=\"wp-block-code\"><code>better-recent-comments\/better-recent-comments\/src\/Plugin.php<\/code><\/pre>\n                    \n        <div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n        \n        \n        \n        <h2 class=\"wp-block-heading\">Conclusion<\/h2>\n        \n        \n        \n        <p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Better Recent Comments Plugin shortcode<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n        ","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Better Recent Comments Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Better Recent Comments Plugin shortcode not to show or not to work correctly. Before starting, here is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Better Recent Comments","slug":"","version":"1.1.8","author":"<a href=\"https:\/\/barn2.com\">Barn2 Plugins<\/a>","icons":"https:\/\/ps.w.org\/better-recent-comments\/assets\/icon-128x128.png?rev=2771699","plugin_tags":"{\"avatar\":\"avatar\",\"comments\":\"comments\",\"shortcode\":\"shortcode\",\"widget\":\"widget\",\"wpml\":\"wpml\"}","author_profile":"https:\/\/profiles.wordpress.org\/barn2media\/","requires":"5.1","tested":"6.3.2","requires_php":"7.1","rating":92,"num_ratings":17,"active_installs":3000,"downloaded":52933,"last_updated":"2023-08-23 10:13am GMT","added":"2016-02-02","homepage":"https:\/\/wordpress.org\/plugins\/better-recent-comments\/","short_description":"Provides an improved Recent Comments widget and a shortcode to display your recent comments on any post or page.","description":"\"Better Recent Comments is a user-friendly WordPress plugin that enhances the visibility of the latest comments on your blog, improving engagement and interaction.\"","shortcodes":"[\"better_recent_comments\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2064","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=2064"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2064\/revisions"}],"predecessor-version":[{"id":2568,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2064\/revisions\/2568"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=2064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=2064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=2064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}