Support » Plugins » Comments Link on index page – can it be geyed when

  • Resolved Anonymous

    Is there a way to have the comments greyed out when a post has the comments switched off?
    At the moment when I switch comments off it still lets you click the comments link.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ryan Boren


    WordPress Dev

    You have to turn off both comments and pings.

    I’ve posted a snippet of script(s) at It contains a new function, plus the topmost (in the file..) following comments_ tag functions from template-functions.php. At some point, I’ll start posting these things as actual posts on the site. 😉
    Note that I didn’t want to put up my entire template-functions, as I have other extensive modifications, and they wouldn’t work on vanilla WP sites.
    These encapsulated changes should work with relatively recent (1.0ish) versions… though my usual CAVEAT: I’m not always running a match set of code to any particular WP release, and thus some of the code may not work without a little tweaking.
    What does my modification do:
    1. new tag get_comments_number returns the integer count of comments for the current post.
    2. adds caching, so that the comment count isn’t looked up multiple times for a single post.
    3. comments_number now returns the raw string, not a link.
    4. comments_popup_link in this version actually returns a BLANK string for a ‘closed’ post with 0 comments, the ‘no comments’ string if 0 comments on an open post (but NOT as link, just a string), and the ‘normal’ comments link if 1 or more comments for the post. To put it another way, closed posts with no comments show no link or text, open posts with no comments just show the no comments text, and all other cases work as WP release used to.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Comments Link on index page – can it be geyed when’ is closed to new replies.