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 display...) |
无编辑摘要 |
||
第1行: | 第1行: | ||
== Description == | == Description == | ||
== 描述 == | |||
Outputs a [[WordPress:Glossary#Permalink|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]]. | Outputs a [[WordPress:Glossary#Permalink|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]]. | ||
产出一篇文章的[[WordPress:Glossary#Permalink|permalink]] anchor标识符或者id (<a id="....),对于链接到一个拥有几篇文章的网页,如归档网页上,这很有用。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | |||
== Usage == | == Usage == | ||
== 用法 == | |||
%%% <?php permalink_anchor('type'); ?> %%% | |||
%%% <?php permalink_anchor('type'); ?> %%% | %%% <?php permalink_anchor('type'); ?> %%% | ||
== Example == | == Example == | ||
==例子 == | |||
Inserts the permalink anchor next to a post's title. | Inserts the permalink anchor next to a post's title. | ||
将permalink anchor插入到文章标题的旁边。 | |||
<h3><?php permalink_anchor(); ?><?php the_title(); ?></h3> | <h3><?php permalink_anchor(); ?><?php the_title(); ?></h3> | ||
<h3><?php permalink_anchor(); ?><?php the_title(); ?></h3> | |||
== Parameters == | == Parameters == | ||
== 参数 == | |||
; type : (''string'') Type of anchor to output. Valid values are: | ; type : (''string'') Type of anchor to output. Valid values are: | ||
;类型:(''string'')要输出的anchor。有效的参数值是: | |||
:* <tt>'id'</tt> - Anchor equals numeric post ID. This is the default. | :* <tt>'id'</tt> - Anchor equals numeric post ID. This is the default. | ||
:* <tt>'id'</tt> -Anchor等同与文章ID数字。这是默认的。 | |||
:* <tt>'title'</tt> - Anchor equals postname, i.e. [[WordPress:Glossary#Post Slug|post slug]]. | :* <tt>'title'</tt> - Anchor equals postname, i.e. [[WordPress:Glossary#Post Slug|post slug]]. | ||
:* <tt>'title'</tt> - Anchor 等同于文章名,例如 [[WordPress:Glossary#Post Slug|文章 slug]]。 | |||
== Related == | == Related == | ||
第24行: | 第47行: | ||
{{Tag Footer}} | {{Tag Footer}} | ||
== 相关的== | |||
{{标签Permalink标签}} | |||
{{标签页底文字}} |
2008年7月9日 (三) 13:55的版本
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.
产出一篇文章的permalink anchor标识符或者id (<a id="....),对于链接到一个拥有几篇文章的网页,如归档网页上,这很有用。必须在The Loop内使用这个标签。
Usage
用法
%%% <?php permalink_anchor('type'); ?> %%%
%%% <?php permalink_anchor('type'); ?> %%%
Example
例子
Inserts the permalink anchor next to a post's title. 将permalink anchor插入到文章标题的旁边。
<h3><?php permalink_anchor(); ?><?php the_title(); ?></h3>
<h3><?php permalink_anchor(); ?><?php the_title(); ?></h3>
Parameters
参数
- type
- (string) Type of anchor to output. Valid values are:
;类型:(string)要输出的anchor。有效的参数值是:
- 'id' - Anchor equals numeric post ID. This is the default.
- 'id' -Anchor等同与文章ID数字。这是默认的。
- 'title' - Anchor equals postname, i.e. post slug.
- 'title' - Anchor 等同于文章名,例如 文章 slug。