mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-20 04:00:29 +08:00
Merge pull request #1003 from woocommerce/fix/no-comments
Remove 'comments closed' message from pages
This commit is contained in:
commit
0b4dd67231
2 changed files with 3 additions and 3 deletions
|
@ -65,7 +65,7 @@ if ( post_password_required() ) {
|
|||
|
||||
endif;
|
||||
|
||||
if ( ! comments_open() && 0 !== get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
|
||||
if ( ! comments_open() && 0 !== intval( get_comments_number() ) && post_type_supports( get_post_type(), 'comments' ) ) :
|
||||
?>
|
||||
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'storefront' ); ?></p>
|
||||
<?php
|
||||
|
|
|
@ -13,7 +13,7 @@ if ( ! function_exists( 'storefront_display_comments' ) ) {
|
|||
*/
|
||||
function storefront_display_comments() {
|
||||
// If comments are open or we have at least one comment, load up the comment template.
|
||||
if ( comments_open() || 0 !== get_comments_number() ) :
|
||||
if ( comments_open() || 0 !== intval( get_comments_number() ) ) :
|
||||
comments_template();
|
||||
endif;
|
||||
}
|
||||
|
@ -451,7 +451,7 @@ if ( ! function_exists( 'storefront_post_meta' ) ) {
|
|||
// Comments.
|
||||
$comments = '';
|
||||
|
||||
if ( ! post_password_required() && ( comments_open() || '0' !== get_comments_number() ) ) {
|
||||
if ( ! post_password_required() && ( comments_open() || 0 !== intval( get_comments_number() ) ) ) {
|
||||
$comments_number = get_comments_number_text( __( 'Leave a comment', 'storefront' ), __( '1 Comment', 'storefront' ), __( '% Comments', 'storefront' ) );
|
||||
|
||||
$comments = sprintf(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue