Hi AZBros. The post comment count located in the page title is created by calling /parts/page-title.php in single.php. We’ll copy the same data to the single.php file and then position it with CSS.
1. Copy single.php to your child theme.
2. Near the top of single.php add the comment count (from page-title.php) below the author-date:
<h1 class="post-title entry-title"><?php the_title(); ?></h1>
<?php get_template_part('parts/single-author-date'); ?>
<!-- add post comment count -->
<ul class="meta-single group">
<?php if ( comments_open() && ( hu_is_checked( 'comment-count' ) ) ): ?>
<li class="comments"><a href="<?php comments_link(); ?>"><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></a></li>
<?php endif; ?>
</ul>
<?php if( get_post_format() ) { get_template_part('parts/post-formats'); } ?>
<div class="clear"></div>
3. Add some CSS for positioning:
/* hide comment count in page title */
.single .page-title .comments {
display: none;
}
/* move post up */
.single .page-title {
padding-bottom: 0;
border-bottom: none;
}
.single .content .pad:not(.page-title) {
padding-top: 0;
}
/* position post meta data */
.single .post-title {
margin-bottom: 0;
}
.single .post-byline {
float: left;
margin-right: 20px;
}
Thread Starter
AZBros
(@azbros)
Wow, that is exactly what I was wanting! You never fail to amaze me. Thank you so much, you’ve really helped me out a lot!
(@azbros)
7 years, 11 months ago
On this theme, the Category and Comment Count are listed at the very top of the page when viewing a Post. I’d like to adjust them slightly. First of all, there is a fairly large space between the Category and the Post Title. I think decreasing that so they’re closer would be nice.
Regarding the Post Count, I’d like to be able to move it from the upper right corner down near the Post Date and Author.
For reference, here is an image of what I’d like to accomplish: http://imgur.com/EVVYtFl