WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/comment link

Description

Display the full, anchored URL to a single comment. This function must be used within the comments loop.

If you want to link to all of the comments for an entry, use the function comments_link() instead.

Usage

<?php comment_link() ?>

Parameters

None.

Return Values

(void) 
This function does not return a value.

Examples

Create an anchored permalink to a single comment:

<a href="<?php comment_link(); ?>">Permalink to this comment</a>

The code shown above will result (depending on your permalink settings) in something like this:

<a href="http://example.com/2009/07/15/example-post/comment-page-1/#comment-3">Permalink to this comment</a>

Notes

Change Log

Since: 1.5.0

Source File

comment_link() is located in wp-includes/feed.php.

Related

See also index of Function Reference and index of Template Tags.