Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a plugin which would allow visitors to load comments when they want to, rather than always showing them by default? Preferably through an AJAX call or something to prevent page reload.

I'm thinking a nice and visible link or button with View n comments or something along those lines. Hope I'm making sense :)

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

A solution oriented around users without javascript:

  1. Apply a wrapper div to your comments, leave everything else (including CSS as is)
  2. On page load, use javascript to hide the wrapper and display a link or button or something for 'view comments'
  3. onclick 'view comments', fade/slide the comments in.

The advantage to this is that your comments will still be visible to those not using javascript (specifically: search engines), but it will behave exactly like it would if you made the changes in the CSS.

share|improve this answer
    
Don't really care that much about users without javascript, but search engines is a good point. Maybe I'll go for this. How would you wrap the comments in a div? And where would you put the javascript? –  Svish Feb 7 '12 at 11:14
    
You really should care about users without javascript...it's not much, but even 1% of the internet is a tremendous number of people, and you have to think about them for search engines anyways...progressive enhancement is the name of the game. div should go in comments.php, and you can put the .js wherever, just enqueue it correctly. –  m0r7if3r Feb 7 '12 at 11:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.