WordPress: Template Tags/the permalink:修订间差异
来自站长百科
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
== 描述 == | == 描述 == | ||
显示当前正在[[WordPress:The Loop|The Loop]]中处理的文章的[[WordPress:Glossary#Permalink|permalink]]的[[WordPress:Glossary#URI and URL|URL]]。这个标签必须用于[[WordPress:The Loop|The Loop]]内部,一般是显示文章的时候,这个标签用来显示每篇文章的permalink。因为这个标签限制为显示正在处理的文章的permalink,你不能使用这个标签来显示网络日志上任意一篇文章的permalink。如果你想要显示某个id数字的文章的permalink,请参考[[WordPress:Template_Tags/get_permalink|get_permalink()]]。 | 显示当前正在[[WordPress:The Loop|The Loop]]中处理的文章的[[WordPress:Glossary#Permalink|permalink]]的[[WordPress:Glossary#URI and URL|URL]]。这个标签必须用于[[WordPress:The Loop|The Loop]]内部,一般是显示文章的时候,这个标签用来显示每篇文章的permalink。因为这个标签限制为显示正在处理的文章的permalink,你不能使用这个标签来显示网络日志上任意一篇文章的permalink。如果你想要显示某个id数字的文章的permalink,请参考[[WordPress:Template_Tags/get_permalink|get_permalink()]]。 | ||
== 用法 == | == 用法 == | ||
%%% <?php the_permalink(); ?> %%% | %%% <?php the_permalink(); ?> %%% | ||
==例子 == | ==例子 == | ||
=== 将文章URL作为文本显示=== | === 将文章URL作为文本显示=== | ||
显示文章的URL,没有创建链接: | 显示文章的URL,没有创建链接: | ||
这篇文章的这个地址是:<?php the_permalink(); ?> | 这篇文章的这个地址是:<?php the_permalink(); ?> | ||
=== 作为带有文本的链接=== | === 作为带有文本的链接=== | ||
你可以使用任何你喜欢的文本作为链接文本,在这个例子中是,"permalink"。 | 你可以使用任何你喜欢的文本作为链接文本,在这个例子中是,"permalink"。 | ||
<a href="<?php the_permalink(); ?>">permalink</a> | <a href="<?php the_permalink(); ?>">permalink</a> | ||
=== 用作带有标题标签的链接=== | === 用作带有标题标签的链接=== | ||
为permalink创建一个链接,将文章标题作为链接文本。这是处理文章标题的一种常见的方法。 | 为permalink创建一个链接,将文章标题作为链接文本。这是处理文章标题的一种常见的方法。 | ||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> | <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> | ||
== 参数 == | == 参数 == | ||
这个标签没有参数。 | 这个标签没有参数。 | ||
== 相关的== | == 相关的== | ||
要为一篇单一的,特别的文章,创建permalink,请看看[[WordPress:Template_Tags/get_permalink|get_permalink]]。 | 要为一篇单一的,特别的文章,创建permalink,请看看[[WordPress:Template_Tags/get_permalink|get_permalink]]。 | ||
{{标签Permalink标签}} | {{标签Permalink标签}} | ||
{{没有 Param标签页底文字}} | {{没有 Param标签页底文字}} |
2008年7月17日 (四) 10:49的最新版本
描述[ ]
显示当前正在The Loop中处理的文章的permalink的URL。这个标签必须用于The Loop内部,一般是显示文章的时候,这个标签用来显示每篇文章的permalink。因为这个标签限制为显示正在处理的文章的permalink,你不能使用这个标签来显示网络日志上任意一篇文章的permalink。如果你想要显示某个id数字的文章的permalink,请参考get_permalink()。
用法[ ]
%%% <?php the_permalink(); ?> %%%
例子[ ]
将文章URL作为文本显示[ ]
显示文章的URL,没有创建链接:
这篇文章的这个地址是:<?php the_permalink(); ?>
作为带有文本的链接[ ]
你可以使用任何你喜欢的文本作为链接文本,在这个例子中是,"permalink"。
<a href="<?php the_permalink(); ?>">permalink</a>
用作带有标题标签的链接[ ]
为permalink创建一个链接,将文章标题作为链接文本。这是处理文章标题的一种常见的方法。
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
参数[ ]
这个标签没有参数。
相关的[ ]
要为一篇单一的,特别的文章,创建permalink,请看看get_permalink。