[Resolved] Add comment number below comment title

Home Forums Support Add comment number below comment title

  • This topic has 4 replies, 2 voices, and was last updated 4 months ago by David.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1507700
    George

    I am adding the total comment below the comment title like this:

    add_action( 'generate_below_comments_title','generate_comments_email_message' );
    function generate_comments_email_message()
    {
        ?>
        <p class="total-comments">Total Comments:( 2 )</p>
        <?php
    }

    and I want to replace the number 2 with the post comment count.

    Any suggestions?

    #1507743
    George

    I used this code, is there a more streamlined way?

    add_action( 'generate_below_comments_title','generate_comments_email_message' );
    function generate_comments_email_message()
    {
    	
        ?>
        <p class="total-comments">Total Comments: (  <?php comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1', 'generatepress' ), __( '%', 'generatepress' ) ); ?> ) </p>
        <?php
    }
    #1508104
    David
    Staff
    Customer Support

    Hi there,

    thats a perfectly good way yo do it.
    Tom does provide an option to include it in the meta here:

    https://generatepress.com/forums/topic/comment-count-in-meta-of-single-post/#post-1478842

    #1508108
    George

    Ok, I will leave it as it is, then.

    Thanks, David.

    #1508114
    David
    Staff
    Customer Support
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.