Created
August 11, 2015 11:11
-
-
Save wbxpress/4b328f0e18326958260e to your computer and use it in GitHub Desktop.
wbxpress-one theme's comments file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( post_password_required() ) { | |
return; | |
} | |
function wbxpressone_comment_nav() { | |
// Are there comments to navigate through? | |
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : | |
?> | |
<nav class="navigation comment-navigation"> | |
<div class="nav-links"> | |
<?php | |
if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'wbxpress-one' ) ) ) : | |
printf( '<div class="nav-previous">%s</div>', $prev_link ); | |
endif; | |
if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'wbxpress-one' ) ) ) : | |
printf( '<div class="nav-next">%s</div>', $next_link ); | |
endif; | |
?> | |
</div><!-- .nav-links --> | |
</nav><!-- .comment-navigation --> | |
<?php | |
endif; | |
} | |
?> | |
<div id="comments"> | |
<h3 id="comments-title"> | |
<?php | |
printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'wbxpress-one' ), | |
number_format_i18n( get_comments_number() ), get_the_title() ); | |
?> | |
</h3> | |
<?php wbxpressone_comment_nav(); ?> | |
<?php if ( have_comments() ) : ?> | |
<ul class="commentlist"> | |
<?php | |
wp_list_comments( array( | |
'style' => 'ul', | |
'short_ping' => true, | |
'avatar_size' => 56, | |
) ); | |
?> | |
</ul> | |
<?php wbxpressone_comment_nav(); ?> | |
<?php endif; ?> | |
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> | |
<p class="no-comments"><?php _e( 'Comments are closed.', 'wbxpress-one' ); ?></p> | |
<?php endif; ?> | |
<?php comment_form(); ?> | |
</div><!-- #comments --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment