bridges2610
Member
Posted 1 year ago #
Hi,
I have a site that enables comments on the homepage. The problem is, when you click comments, all of the comments on the homepage open up. I just need the comments for that particular post to open. Can someone give me some assistance? The url is: designseedz.com
Thanks in advance!
I see you're using jQuery to toggle comments for each post.
The problem with your code is that the click function is set to toggle divs with the .comment-wrapper class.
Seeing as each post has it's own comment-wrapper class, clicking any of the comment links will open all comment divs.
What you need to do is give the comment list for each post a unique id.
Then use jQuery to toggle the comments for that post only.
This might help:
http://stackoverflow.com/questions/2082218/jquery-toggle-show-hide-w-multiple-div-ids/2082277#2082277
Have fun =)