WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comment Anchors (2 posts)

  1. juneatnoon
    Member
    Posted 4 years ago #

    After reading how some people are really bothered by popup windows, I decided not to use comment popups. Instead I'd like my comment link to just open up the comments on the post. I used an anchor to take the link to the comments, but if there are no comments on a particular post, it just goes to the beginning of the post instead of to the comment form. Any way around this?

  2. juneatnoon
    Member
    Posted 4 years ago #

    Aha! Nevermind, I figured it out.

    In case anyone else has the same problem:

    I put my anchor tag in front of the comments heading (<h5 id="comments">Comments</h5>) and also in front of the comment form (<h5 id="comments">Leave a Comment</h5>). If there are comments, then the page lists those comments and the link automatically starts you there, with the comment form below, because of the anchor (and because that anchor occurs first). If there are no comments, the page will only show the comment form, and since that also has an anchor tag, the link will take you there. Much easier than I was making it. Phew!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.