WordPress: Template Tags/permalink anchor:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
 
第1行: 第1行:
== 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]].


产出一篇文章的[[WordPress:Glossary#Permalink|permalink]] anchor标识符或者id (<a id="....),对于链接到一个拥有几篇文章的网页,如归档网页上,这很有用。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。
产出一篇文章的[[WordPress:Glossary#Permalink|permalink]] anchor标识符或者id (<a id="....),对于链接到一个拥有几篇文章的网页,如归档网页上,这很有用。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。
== Usage ==


== 用法 ==
== 用法 ==


%%% <?php permalink_anchor('type'); ?> %%%  
%%% <?php permalink_anchor('type'); ?> %%%  
%%% <?php permalink_anchor('type'); ?> %%%
== Example ==


==例子 ==
==例子 ==


Inserts the permalink anchor next to a post's title.
将permalink anchor插入到文章标题的旁边。
将permalink anchor插入到文章标题的旁边。
&lt;h3&gt;<?php permalink_anchor(); ?><?php the_title(); ?>&lt;/h3&gt;


&lt;h3&gt;<?php permalink_anchor(); ?><?php the_title(); ?>&lt;/h3&gt;
&lt;h3&gt;<?php permalink_anchor(); ?><?php the_title(); ?>&lt;/h3&gt;
== Parameters ==


== 参数 ==
== 参数 ==


; type : (''string'') Type of anchor to output. Valid values are:
; type : (''string'') 要输出的anchor。有效的参数值是:
 
;类型:(''string'')要输出的anchor。有效的参数值是:
 
:* <tt>'id'</tt> - Anchor equals numeric post ID. This is the default.


:* <tt>'id'</tt> -Anchor等同与文章ID数字。这是默认的。
:* <tt>'id'</tt> - Anchor等同与文章ID数字。这是默认的。
 
:* <tt>'title'</tt> - Anchor equals postname, i.e. [[WordPress:Glossary#Post Slug|post slug]].


:* <tt>'title'</tt> - Anchor 等同于文章名,例如 [[WordPress:Glossary#Post Slug|文章 slug]]。
:* <tt>'title'</tt> - Anchor 等同于文章名,例如 [[WordPress:Glossary#Post Slug|文章 slug]]。
== Related ==
{{Tag Permalink Tags}}
{{Tag Footer}}


== 相关的==
== 相关的==

2008年7月17日 (四) 10:37的最新版本

描述[ ]

产出一篇文章的permalink anchor标识符或者id (<a id="....),对于链接到一个拥有几篇文章的网页,如归档网页上,这很有用。必须在The Loop内使用这个标签。

用法[ ]

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

例子[ ]

将permalink anchor插入到文章标题的旁边。

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

参数[ ]

type
(string) 要输出的anchor。有效的参数值是:
  • 'id' - Anchor等同与文章ID数字。这是默认的。
  • 'title' - Anchor 等同于文章名,例如 文章 slug

相关的[ ]

模板:标签Permalink标签

模板:标签页底文字