the_permalink

PERMALINK TAG

What It Does

Displays the permalink for the current post. the_permalink must be used within The Loop. To display the permalink for a specified post, use get_permalink.

Code

<?php the_permalink(); ?>

Example

To link to the current post using the title as the anchor text, you can use the following:

<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a>