Linking to Page Showing Only Comments Without Parent Post

I’d like to show post comments on their own page without the parent post. I know I can use wp_list_comments() on the single post page and pass a callback function to use my own comment display markup. I plan to do this so I can include a link with each comment that will show that comment on it’s own page.

If this weren’t WordPress I’d use:

<a href = " = $comment_id">View single comment</a>

…and grab the $comment_id from the query string.

What would that link look like in WordPress? ie: what string would I include to get directly to, let’s say, my_comments.php where I call get_comment($comment_id) and comment_template()?

<a href = "<?php bloginfo("url');?>/what/goes/here?comment_id = $comment_id"<View single comment</a>

2 s

You could probably just create a new page in WordPress, and give that page a custom template. Then the url would just be whatever it normally would be to get to that page. The only difference is that the custom template you are using would be setup to accept the comment_id via the querystring, and then just get the details for the specific comment, and in the template code echo out the details of the comment.

So, if you have a page in wordpress called “Comment Details” that you create, you could access that page via (assuming you have permalinks enabled). So your link would look like this:

<a href = "<?php bloginfo("url');?>/comment-details?comment_id=$comment_id">View single comment</a>

The “Comment Details” page would be set up to use a custom template that would contain the code to spit out the details.

Leave a Comment