Skip to content

Instantly share code, notes, and snippets.

@wbxpress
Created August 11, 2015 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbxpress/4b328f0e18326958260e to your computer and use it in GitHub Desktop.
Save wbxpress/4b328f0e18326958260e to your computer and use it in GitHub Desktop.
wbxpress-one theme's comments file.
<?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 &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', 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