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

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == Displays the URL for the permalink to the post currently being processed in WordPress:The Loop. ...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== Description ==
== 描述 ==


Displays the [[WordPress:Glossary#URI and URL|URL]] for the [[WordPress:Glossary#Permalink|permalink]] to the post currently being processed in [[WordPress:The Loop]]. This tag must be within [[WordPress:The Loop]], and is generally used to display the permalink for each post, when the posts are being displayed. Since this template tag is limited to displaying the permalink for the post that is being processed, you cannot use it to display the permalink to an arbitrary post on your weblog. Refer to [[WordPress:Template_Tags/get_permalink|get_permalink()]] if you want to display the permalink for a post, given its unique post id.
Displays the [[WordPress:Glossary#URI and URL|URL]] for the [[WordPress:Glossary#Permalink|permalink]] to the post currently being processed in [[WordPress:The Loop]]. This tag must be within [[WordPress:The Loop]], and is generally used to display the permalink for each post, when the posts are being displayed. Since this template tag is limited to displaying the permalink for the post that is being processed, you cannot use it to display the permalink to an arbitrary post on your weblog. Refer to [[WordPress:Template_Tags/get_permalink|get_permalink()]] if you want to display the permalink for a post, given its unique post id.
显示当前正在[[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()]]。


== Usage ==
== Usage ==
== 用法 ==
%%% <?php the_permalink(); ?> %%%


%%% <?php the_permalink(); ?> %%%
%%% <?php the_permalink(); ?> %%%


== Examples ==
== Examples ==
==例子 ==


=== Display Post URL as Text ===
=== Display Post URL as Text ===
=== 将文章URL作为文本显示===


Displays the URL to the post, without creating a link:
Displays the URL to the post, without creating a link:
显示文章的URL,没有创建链接:


  This address for this post is: &lt;?php the_permalink(); ?&gt;
  This address for this post is: &lt;?php the_permalink(); ?&gt;
这篇文章的这个地址是:&lt;?php the_permalink(); ?&gt;


=== As Link With Text ===
=== As Link With Text ===
=== 作为带有文本的链接===


You can use whatever text you like as the link text, in this case, "permalink".
You can use whatever text you like as the link text, in this case, "permalink".
你可以使用任何你喜欢的文本作为链接文本,在这个例子中是,"permalink"。


  &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;permalink&lt;/a&gt;
  &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;permalink&lt;/a&gt;
&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;permalink&lt;/a&gt;


=== Used as Link With Title Tag===
=== Used as Link With Title Tag===
=== 用作带有标题标签的链接===


Creates a link for the permalink, with the post's title as the link text. This is a common way to put the post's title.
Creates a link for the permalink, with the post's title as the link text. This is a common way to put the post's title.
为permalink创建一个链接,将文章标题作为链接文本。这是处理文章标题的一种常见的方法。


  &lt;a href="<?php the_permalink(); ?>"&gt;<?php the_title(); ?>&lt;/a&gt;
  &lt;a href="<?php the_permalink(); ?>"&gt;<?php the_title(); ?>&lt;/a&gt;
&lt;a href="<?php the_permalink(); ?>"&gt;<?php the_title(); ?>&lt;/a&gt;


== Parameters ==
== Parameters ==
== 参数 ==


This tag has no parameters.
This tag has no parameters.
这个标签没有参数。
== Related ==
== 相关的==


== Related ==
To generate the permalink for a single, specific post, see [[WordPress:Template_Tags/get_permalink|get_permalink]].
To generate the permalink for a single, specific post, see [[WordPress:Template_Tags/get_permalink|get_permalink]].
要为一篇单一的,特别的文章,创建permalink,请看看[[WordPress:Template_Tags/get_permalink|get_permalink]]。


{{Tag Permalink Tags}}
{{Tag Permalink Tags}}


{{No Param Tag Footer}}
{{No Param Tag Footer}}
{{标签Permalink标签}}
{{没有 Param标签页底文字}}

2008年7月9日 (三) 14:01的版本

Description

描述

Displays the URL for the permalink to the post currently being processed in WordPress:The Loop. This tag must be within WordPress:The Loop, and is generally used to display the permalink for each post, when the posts are being displayed. Since this template tag is limited to displaying the permalink for the post that is being processed, you cannot use it to display the permalink to an arbitrary post on your weblog. Refer to get_permalink() if you want to display the permalink for a post, given its unique post id.

显示当前正在The Loop中处理的文章的permalinkURL。这个标签必须用于The Loop内部,一般是显示文章的时候,这个标签用来显示每篇文章的permalink。因为这个标签限制为显示正在处理的文章的permalink,你不能使用这个标签来显示网络日志上任意一篇文章的permalink。如果你想要显示某个id数字的文章的permalink,请参考get_permalink()

Usage

用法

%%% <?php the_permalink(); ?> %%%

%%% <?php the_permalink(); ?> %%%

Examples

例子

Display Post URL as Text

将文章URL作为文本显示

Displays the URL to the post, without creating a link:

显示文章的URL,没有创建链接:

This address for this post is: <?php the_permalink(); ?>

这篇文章的这个地址是:<?php the_permalink(); ?>

As Link With Text

作为带有文本的链接

You can use whatever text you like as the link text, in this case, "permalink".

你可以使用任何你喜欢的文本作为链接文本,在这个例子中是,"permalink"。

<a href="<?php the_permalink(); ?>">permalink</a>

<a href="<?php the_permalink(); ?>">permalink</a>

Used as Link With Title Tag

用作带有标题标签的链接

Creates a link for the permalink, with the post's title as the link text. This is a common way to put the post's title.

为permalink创建一个链接,将文章标题作为链接文本。这是处理文章标题的一种常见的方法。

<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

Parameters

参数

This tag has no parameters. 这个标签没有参数。

Related

相关的

To generate the permalink for a single, specific post, see get_permalink.

要为一篇单一的,特别的文章,创建permalink,请看看get_permalink

模板:Tag Permalink Tags

模板:No Param Tag Footer

模板:标签Permalink标签