WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/comment link

Contents

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.