WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Are there any tags to show total posts and comment (8 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    Hi
    I would love to be able to show total posts and total comments like;
    'View all 500 posts' and 'there are 10 comments'
    Are there any tags that do this?
    Thanks
    Karl

  2. Nick Momrik
    Member
    Posted 10 years ago #

    Do you want them to have a link so that when you click on them it shows ALL of your posts or ALL of you comments? Or do you simple want something to count the number of posts and number of comments and display a statistic?

  3. Nick Momrik
    Member
    Posted 10 years ago #

    I have a couple of functions on my site that I use for stats. See my hacks at http://mtdewvirus.com/wp-hacks/

  4. KarlB
    Member
    Posted 10 years ago #

    Wicked!
    Thanks for that :)
    Karl

  5. Nick Momrik
    Member
    Posted 10 years ago #

    Karl,
    Check the new function out. ;-)
    comments_popup_link counts the number of comments for a post, but returns it as a link. I'm assuming you wanted what I came up with, just a text count of the comments.
    -Nick

  6. KarlB
    Member
    Posted 10 years ago #

    Hi Nick,
    Yes thats is correct Sir! :)
    Your function works fine - I didn't read the label properly :)
    I wondered though if there is a way to say 'No comment', 1 comment etc.
    T ried this in the brackets of your function but it didn't work.
    'Want to reply?', '1 Comment', '% Comments'
    Thanks
    Karl

  7. Nick Momrik
    Member
    Posted 10 years ago #

    From what you say now, it sounds like you want this to be a link, which then shows the comments section of the post. You should be using comments_popup_link (which does't actually create a popup if popup comments are turned off) for this. Take a look at my site...is that how you want it?
    If so, do this: comments_popup_link('Want to reply?', '1 Comment', '% Comments') where you call this function.

  8. Jeff Starr
    Member
    Posted 7 years ago #

    Here is a plugin that will display the total number of blog posts, comments, categories, or any combination thereof:
    BlogStats PCC

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.