Pro Theme Design Forum » Mimbo Pro » Technical Help
Comment count only if comments
|
I'm not sure if this is possible but on the home page, I'd like no comment count to show up if there are zero comments - only a number to appear if there are any comments. Is that possible and what code would I use? If not, how would I remove the count from the titles - appears only on the home page on the lead story and then the top story in the category modules in the center of the page (Above the carousel). I don't mind the little comment icon - doesn't bother me and encourages comments. p.s. While I'm asking - I'd love to turn the comments off but I do not want "(Comments Off) to appear anywhere. or Comments Closed. This audience is just not very comment likely so I want to limit it - but don't want that unfriendly text to appear. thanks! :-) |
|
|
To adjust the homepage you can simply remove the functions that call the comment counts (calls to comments_popup_link). If you want to remove comments from the site entirely then I would simply remove the call to the comments code from single.php (remove this - comments_template();). I don't think removing it will break anything and it's the quickest way to remove the functionality. |
|
Thanks, Ben - is it possible thought to do something if = 0, then show nothing (or a space), if > 1 show count? I have no idea how I would change that function... I can do CSS but the functions code is a bit beyond me... :-) |
|
Sorry - I'm back. I'm still perplexed on not only the count issue above, but just how to remove the text that's placed. The two in particular, "Comments Off" or "Comments Closed" that appear if I either univerally turn comments off or just choose to on a particular post. I'd like to keep the functionality - just not the "harsh" notification language. thx... |
|
Argh - OK, I found where you can change what appears for (0), (1), (2), etc on the lead story and category templates. (Not sure what I'm going to do b/c I have to lose the parens if I make the zero a blanks space. And, I removed "Comments Closed" if the comments are turned off ON a particular post or page - but what I cannot find is where the code is that makes the words, "(Comments off)" appear in the main category boxes on the front page. It's got to be in the code somewhere that I can't see? I went through the index.php, the comments.php - Can you please help? Thanks - |
|
|
The code on the homepage is in the same function as the (0) (1) (2) - it's built into WordPress so I am not sure of any easy fix for that :( |
|
Blurgh, as Liz Lemon would say. I've never seen it show "Comments Off" before - I have several other WP sites. Is there code in Mimbo Pro that's pulling that from somewhere - code I might be able to change. I really have not seen it - I've seen "Comments Closed" on a page or post, but never "comments off" and then it appears so prominently in Mimbo Pro. Sigh... It's going to leave me with no choice but to force comments everywhere which I don't really want to do... |
|
|
Who or what is Liz Lemon? :S The code that displays the comment count (and the "Comments Off" text) is the built in WordPress function comments_popup_link (more info here - http://codex.wordpress.org/Template_Tags/comments_popup_link) I've read through the post and it looks like you can override the "comments off" text by adding two more parameters. The default values for Mimbo Pro would look like this:
|
|
Hi - hee, hee! Sorry, Liz Lemon is from 30Rock, the TV show (and is Tina Fey, the actress) - who says, "Blurgh." when she's frustrated. ;-) Thanks for digging into this - where exactly is that code? I think I looked in the usual spots but didn't find that line? Thanks - |
|
|
The code you want to change is in index.php. We used the default values for two of the parameters which is why I didn't know you could override the text. I would simply search for comments_popup_link and then add the last two parameters in the function call from above (the "", __("Comments Off") bit |
Reply
You must log in to post.
not a support question