Relative Urls for comments (3 posts)

  1. streetlight708
    Posted 3 years ago #

    Hey everyone,

    I'm working on a site and keep running into a problem.

    I'm trying to code a 'comment' button that appears on both the listing and single post pages, that sends the user to the comments section of the post.

    Right now I'm using '#respond' in my link, but it only works when you click the button on the page itself, because it's a relative url.

    Any suggestions? Please help!

  2. streetlight708
    Posted 3 years ago #

    Or, another way to put it -- is there a way to write a url that would work like '/%post-name%/#respond'?

  3. Give this get_comments_link() article a quick read.

    As long as your using the loop to get the list of posts, this should provide you the link to that post's comment section.

Topic Closed

This topic has been closed to new replies.

About this Topic