{"id":16366436,"date":"2025-12-02T20:00:00","date_gmt":"2025-12-02T20:00:00","guid":{"rendered":"https:\/\/wordpress.org\/documentation\/?post_type=helphub_article&#038;p=16366436"},"modified":"2025-12-01T21:36:56","modified_gmt":"2025-12-01T21:36:56","slug":"comments-count-block","status":"publish","type":"helphub_article","link":"https:\/\/wordpress.org\/documentation\/article\/comments-count-block\/","title":{"rendered":"Comments Count block"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Comments Count block displays the total number of comments for the current post or page. It\u2019s most useful in single post\/page templates or inside a Post Template within a Query Loop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where you can use this block<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Single posts and pages (when comments are enabled).<\/li>\n\n\n\n<li>Post Template inside a Query Loop (for example, on index or archive templates). <\/li>\n\n\n\n<li>Note: The block requires post context. It won\u2019t display on non\u2011singular pages unless it\u2019s inside a Post Template (such as within a Query Loop).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Add the Comments Count block<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a post, page, or template in the editor.<\/li>\n\n\n\n<li>Place your cursor where you want the count to appear (for example, near the byline or meta).<\/li>\n\n\n\n<li>Click the + Block Inserter, search for \u201cComments Count,\u201d and select it. Tip: You can also type \/comments count on a new line to insert it quickly.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Behavior notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The block respects your Discussion settings. If comments are disabled, the count may show 0 or be hidden depending on your theme and settings.<\/li>\n\n\n\n<li>If a post is password\u2011protected, the count may be hidden until the password is entered (behavior can vary by theme).<\/li>\n\n\n\n<li>When used in a Query Loop, each Comments Count displays the correct total for its corresponding post.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Block toolbar<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The block toolbar displays several tools used to customize each block. When you select the\u00a0<strong>Comments Count <\/strong>block, it will show the block toolbar that contains the following tools:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Transform to<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Click on the \u201cTransform\u201d button to convert the <em>Comments Count<\/em> block into a \u201cGroup\u201d, \u201cColumns\u201d, &#8220;Details&#8221;, or &#8220;Comments Count&#8221; block.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1570\" height=\"694\" src=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-transform.png\" alt=\"\" class=\"wp-image-16366449\" srcset=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-transform.png 1570w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-transform-300x133.png 300w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-transform-1024x453.png 1024w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-transform-768x339.png 768w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-transform-1536x679.png 1536w\" sizes=\"auto, (max-width: 1570px) 100vw, 1570px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Drag icon<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To drag and drop the block to a new location, click and hold the rectangle of dots, then drag it to the new location. The blue separator line indicates where the block will be placed. Release the left mouse button when you find the new location to place the block.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1638\" height=\"494\" src=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-drag-1.png\" alt=\"\" class=\"wp-image-16366451\" srcset=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-drag-1.png 1638w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-drag-1-300x90.png 300w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-drag-1-1024x309.png 1024w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-drag-1-768x232.png 768w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-drag-1-1536x463.png 1536w\" sizes=\"auto, (max-width: 1638px) 100vw, 1638px\" \/><\/figure>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#e5f4fa\">Detailed instructions on moving a block within the editor can be found <a href=\"https:\/\/wordpress.org\/support\/article\/moving-blocks\/\">here<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Move arrows<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The up and down arrow icons can be used to move the block up and down on the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"234\" src=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-move-arrow-1-1024x234.png\" alt=\"\" class=\"wp-image-16366453\" srcset=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-move-arrow-1-1024x234.png 1024w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-move-arrow-1-300x69.png 300w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-move-arrow-1-768x176.png 768w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-move-arrow-1-1536x352.png 1536w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-move-arrow-1.png 1642w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Align<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the change alignment tool to align the <em>Comments Count <\/em>block. Choose one of the following options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Align text left<\/strong><\/li>\n\n\n\n<li><strong>Align text right<\/strong><\/li>\n\n\n\n<li><strong>Align text center<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1570\" height=\"494\" src=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-align.png\" alt=\"\" class=\"wp-image-16366454\" srcset=\"https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-align.png 1570w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-align-300x94.png 300w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-align-1024x322.png 1024w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-align-768x242.png 768w, https:\/\/wordpress.org\/documentation\/files\/2025\/11\/comments-count-align-1536x483.png 1536w\" sizes=\"auto, (max-width: 1570px) 100vw, 1570px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Block Settings<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress blocks have specific configuration options in the block settings panel. To access the\u00a0<strong><strong>Comments Count<\/strong>\u00a0<\/strong>block settings panel, click the\u00a0<strong>Settings<\/strong>\u00a0button at the top-right corner of the WordPress editor. Alternatively, click the\u00a0<strong>More options<\/strong>\u00a0or three dots icon in the\u00a0<strong><strong>Comments Count<\/strong> <\/strong>block toolbar and select\u00a0<strong>Show more settings<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Color<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<strong><strong>Comments Count<\/strong><\/strong> block provides Color settings options to change the text and background colors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For details refer to this support article:&nbsp;<a href=\"https:\/\/wordpress.org\/documentation\/article\/colors-settings-overview\/\">Color settings overview<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Typography<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<strong>Comments Count<\/strong> block provides typography settings to change the font family, appearance, line height, letter spacing, decoration, letter case, and font size.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For details refer to this support article:&nbsp;<a href=\"https:\/\/wordpress.org\/documentation\/article\/typography-settings-overview\/\">Typography settings overview<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Dimensions<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<strong>Comments Count<\/strong> block provides dimension settings options to add padding and margin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For details refer to this support article:&nbsp;<a href=\"https:\/\/wordpress.org\/documentation\/article\/dimension-controls-overview\/\">Dimension settings overview<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Border<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<strong>Comments Count<\/strong>\u00a0block provides border settings options to add border color, width, and radius.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For details refer to this support article:&nbsp;<a href=\"https:\/\/wordpress.org\/documentation\/article\/border-settings-overview\/\">Border settings overview<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Advanced<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<strong>Advanced<\/strong>\u00a0section allows you to add CSS class(es) to the\u00a0<strong>Comment Count<\/strong> block. Therefore, you can insert custom CSS styles into the block.<\/p>\n\n\n\n<div id=\"changelog\" class=\"wp-block-group changelog has-background is-layout-flow wp-block-group-is-layout-flow\" style=\"background-color:#dce5ec;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">\n<h2 class=\"wp-block-heading has-medium-font-size\">Changelog<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Created 2025-12-02<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Comments Count block displays the total number of comments for the current post or page. It\u2019s most useful in single post\/page templates or inside a Post Template within a Query Loop. Where you can use this block Add the Comments Count block Behavior notes Block toolbar The block toolbar displays several tools used to [&hellip;]<\/p>\n","protected":false},"author":13782018,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false},"category":[80,91],"class_list":["post-16366436","helphub_article","type-helphub_article","status-publish","hentry","category-customization","category-theme-blocks"],"revision_note":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/16366436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles"}],"about":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/types\/helphub_article"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/users\/13782018"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/comments?post=16366436"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/16366436\/revisions"}],"predecessor-version":[{"id":16366455,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/articles\/16366436\/revisions\/16366455"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/media?parent=16366436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.org\/documentation\/wp-json\/wp\/v2\/category?post=16366436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}