Viewing 2 replies - 1 through 2 (of 2 total)
  • 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Decrease Blank Space Above Title; Move Comment Count on Posts’ is closed to new replies.