Skip to content

Commit

Permalink
Removed no comment notice when closed and empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThierryA committed Mar 1, 2016
1 parent 3b0abe6 commit cb8e62e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/render/template-parts.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function beans_comments_template() {

global $post;

if ( !post_type_supports( beans_get( 'post_type', $post ), 'comments' ) )
if ( !( comments_open() || get_comments_number() ) || !post_type_supports( beans_get( 'post_type', $post ), 'comments' ) )
return;

comments_template();
Expand Down
6 changes: 4 additions & 2 deletions lib/templates/structure/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

echo beans_open_markup( 'beans_comments', 'div', array( 'id' => 'comments', 'class' => 'tm-comments' . ( current_theme_supports( 'beans-default-styling' ) ? ' uk-panel-box' : null ) ) );

if ( comments_open( get_the_ID() ) ) :
if ( comments_open() || get_comments_number() ) :

if ( have_comments() ) :

Expand Down Expand Up @@ -48,7 +48,9 @@
*/
do_action( 'beans_after_open_comments' );

else :
endif;

if ( !comments_open() ) :

/**
* Fires if comments are closed.
Expand Down

0 comments on commit cb8e62e

Please sign in to comment.