WordPress.org

Ready to get started?Download WordPress

Forums

Comments on index page to show on one post only (2 posts)

  1. bridges2610
    Member
    Posted 3 years 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!

  2. K-Fella
    Member
    Posted 3 years ago #

    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 =)

Topic Closed

This topic has been closed to new replies.

About this Topic