WordPress:Template Tags/permalink anchor
来自站长百科
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 WordPress: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.