Codex

Template Tags/permalink anchor

Contents

Description

Outputs a permalink anchor identifier or id (<a id="....) for a post. This is useful for linking to a particular post on a page displaying several posts, such as an archive page. This tag must be within The Loop.

Usage

 <?php permalink_anchor('type'); ?> 

Example

Inserts the permalink anchor next to a post's title.

<h3><?php permalink_anchor(); ?><?php the_title(); ?></h3>

Parameters

type 
(string) Type of anchor to output. Valid values are:
  • 'id' - Anchor equals numeric post ID. This is the default.
  • 'title' - Anchor equals postname, i.e. post slug.

Related

permalink_anchor, get_permalink, the_permalink, permalink_single_rss

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