WordPress:Template Tags/permalink anchor

来自站长百科
Xxf3325讨论 | 贡献2008年6月27日 (五) 10:51的版本 (新页面: == 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 display...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

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.

Related

模板:Tag Permalink Tags

模板:Tag Footer