And A WordPress Question

Anyone know of a way to keep the “No Comments” link from showing for posts where comments are disabled? If there’s a way to put that in the template, it would save people from clicking through to comment where they can’t.

image_pdfDownload as PDFimage_printPrint Page

By Holly

Novelist, writing teacher, on a mission to reprint my out-of-print books and indie-publish my new ones.

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

16 Comments
Inline Feedbacks
View all comments
PolarBear
17 years ago

Moderation is a wonderful thing. So far, it’s caught all the spam that’s been tossed to it.

teribella
teribella
17 years ago

Thanks so much for the code! Gonna go play with it now…
Bella

Jason Penney
17 years ago

You know, the comment shows up when I’m logged in, and doesn’t when I’m not.

Is it possible stuck in a moderation queue? I know you don’t like to log into the site, but you might have to to approve the comments with the link (and then you can delete the bad ones).

I probably posted in rapid succession so it thinks I’m a bot.

teribella
teribella
17 years ago

Love the new site set-up… looks great from here! I’ve been using WP for 6+ months now, and I’ve yet been able to figure out how to get the “next/previous entries” to show up on the bottom of the screen… can you tell me what you tweaked to get that to work? Thanks! Bella

Jason Penney
17 years ago

Erg!

The code is here:
http://www.jczorkmid.net/~jpenney/comments_popup_link.txt

Sorry for all the bad posts.

Jason Penney
17 years ago

whoops! missed something there (sorry, delete the other comment if you can):


get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';");
}
$number = $comment_count_cache[$id];
if (($number != 0) && !('closed' == $post->comment_status)) {
comments_popup_link('No Comments', '1 Comment', '% Comments','comments-link','');
}
?>

Jason Penney
17 years ago

Of course I meant, “That last empty string argument is what to display when you have comments disabled.”

Jason Penney
17 years ago

This will get you a little closer to what you want. In your template find the call to comments_popup_link(). It probably looks like this:
comments_popup_link(‘No comments’, ‘1 Comment’, ‘% Comments’);

Change it to this:
comments_popup_link(‘No comments’, ‘1 Comment’, ‘% Comments’,’comments-link’,”);

That last empty string argument is what to display when you have no comments.

That still doesn’t get you the trackback support you want.

Jay

Jason Penney
17 years ago

Have you tried unchecking “Allow comments” and “Allow pings”?

If pings are enabled, they show up as comments. I believe the link is left enabled in case you get any TrackBacks if you just uncheck “Allow comments”.

Jay

16
0
Would love your thoughts, please comment.x
()
x