Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Comments, trackbacks & pings (http://forum.bytesforall.com/forumdisplay.php?f=19)
-   -   Show and Hide comments using 'Show Comments' link (http://forum.bytesforall.com/showthread.php?t=5915)

Alexa Feb 17, 2010 03:48 AM

Show and Hide comments using 'Show Comments' link
 
Good day folks,

I am putting together my site using Atahualpa. I am amazed on a daily basis of just how easy this theme makes configuring my outlays.

There is one little thing I just can't seem to figure out, and I can't find a plugin either. From the little bit of info on the Codex site on something almost simmilar, they mention that it is theme dependend and that the core WP does support such options if called for.

What I would like to do is simply hide all comments to post AND pages throughout the site. I just hate rocking up at a site with just a short post and 99% of the rest of the time loading the thing was spent loading hundreds of comments... On my own blog I would like to hide the comments and the comment box. At the bottom of the post/page entry should simply be a link or whatever on which the visitor could click which would say something like: "Click here to comment to this post and/or view all the comments..."

If there is a some code I should alter or even a plugin anybody out there might know of which would make this happen, I would be most greatfull for your help.

Warm regards,

Alexa

juggledad Feb 17, 2010 05:48 AM

There is nothing 'built-in' to the theme to do what you want. You could probably code a new page and configure it how you want.

Do you know that you can LIMIT the number of comments that are displayed befor a page break occurs (see dashboard->settings->discussion-> Break comments into pages with __ top level comments per page and the __ page displayed by default

Alexa Feb 17, 2010 06:01 AM

Hi there juggledad,

Thanks for your reply and sugestion. For a moment I did actually forget about that trick. I suppose in the end that might be my way out or perhaps just move any discussions to Facebook and keep the CMS style site clean...will have to considder the pro's and con's.

Kind regards,

Rashell Feb 17, 2010 11:06 AM

there's a plugin to hide/show comments called... "Hide or Show Comments". It'll give you a little <?php blurb to add to the loop.

Alexa Feb 17, 2010 11:51 AM

Hi Rashell,

Thanks for that tip, I did actually look at it earlier on as an option, but the PHP blurp spoke of putting it into a theme file called single.php which does not exist in Atahualpa's theme directory. Anyhow, you gave me some new motivation and I found the solution which I'll share here, hopefully someone else on the trail of a simmilar solution could benifit from it.

It downloaded the Hide or Show Comments plugin. I was worried at first and did not give it a fair chance spesifically because it seems like an old plugin which was last updated 2007-10-23 !!!

Anyways. The readme say to replace
Code:

<?php comments_template(); ?>
with
Code:

<?php hideshowComments();?>
in a theme file called "singe.php"

The file does not exist, but I did find and succesfully replace the entry in a file called: "bfa_post_parts.php" in the "functions" folder of Atahualpa theme. The entry is almost right at the bottom, line 236. The php tags are not neccessary so I just replaced the words
Code:

comments_template();
with
Code:

hideshowComments();
That's it! It works pretty good for such a old plugin LOL :P Now I am just going to make it look a bit prettier with some CSS!

Thanks once more for pushing me back towards this very handy little plugin Rashell!


All times are GMT -6. The time now is 04:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.