WordPress.org

Forums

P2
[resolved] Show the number of comments on a post (3 posts)

  1. WPfreak
    Member
    Posted 10 months ago #

    Hello P2 theme team, yours is a master piece and we appreciate its power. However I want to know how best I can add a comments label at the end of a post, before the comments themselves begin? One which reads for example, This post has "2 comments".
    I'm no expert at editing the core of themes or plugins and I dread how updates override changes. I know it must be somewhere in single.php that's all.
    Screenshot is linked below.
    Thanks

    Screenshot

  2. I'm glad you like p2!

    I'm no expert at editing the core of themes or plugins and I dread how updates override changes.

    To avoid having updates overwrite your changes, always restrict your theme tweaks to a child theme. If you do that, your changes will never be overwritten. Here are some guides in case you haven't made one before:

    http://codex.wordpress.org/Child_Themes
    http://op111.net/53/
    http://vimeo.com/49770088

    To add a comment count to single.php, copy the file from your parent theme and place it in the child theme.

    Use this function to add the comment count within the post loop:

    http://codex.wordpress.org/Function_Reference/comments_number

    There's an example here:
    http://codex.wordpress.org/Function_Reference/comments_number#Examples

    Let me know how it goes!

  3. WPfreak
    Member
    Posted 8 months ago #

    Thanks Kathryn

Reply

You must log in to post.

About this Theme

About this Topic

Tags