WordPress: Template Tags/wp get linksbyname:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: {{Deprecated}} == Description == Displays links associated with the named link category. This tag uses the settings you specify in the WordPress:Links Manager. For control over the...)
 
无编辑摘要
第1行: 第1行:
{{Deprecated}}
{{Deprecated}}
== Description ==
== Description ==
{{取消的}}
== 描述 ==


Displays links associated with the named link category.  This tag uses the settings you specify in the [[WordPress:Links Manager]].  For control over the formatting and display of your links within the tag's parameters, see [[WordPress:Template Tags/get_linksbyname|get_linksbyname()]].
Displays links associated with the named link category.  This tag uses the settings you specify in the [[WordPress:Links Manager]].  For control over the formatting and display of your links within the tag's parameters, see [[WordPress:Template Tags/get_linksbyname|get_linksbyname()]].
显示与命名后的链接类别相关的链接。这个标签使用了你在[[WordPress:Links Manager|链接管理器]]中规定的设置。归于在标签的参数内控制你的链接的格式和显示方式,请看看[[WordPress:Template Tags/get_linksbyname|get_linksbyname()]]。


== Replace With ==
== Replace With ==
== 取代 ==
[[WordPress:Template_Tags/wp_list_bookmarks|wp_list_bookmarks()]].


[[WordPress:Template_Tags/wp_list_bookmarks|wp_list_bookmarks()]].
[[WordPress:Template_Tags/wp_list_bookmarks|wp_list_bookmarks()]].


== Usage ==
== Usage ==
== 用法 ==
%%% <?php wp_get_linksbyname('category','arguments'); ?> %%%


%%% <?php wp_get_linksbyname('category','arguments'); ?> %%%
%%% <?php wp_get_linksbyname('category','arguments'); ?> %%%
第15行: 第28行:


===Default Usage===
===Default Usage===
==例子 ==
===默认用法===


By default, the tag shows:
By default, the tag shows:
默认情况下,标签显示:


* All categories if none are specified
* All categories if none are specified
*如果没有特别规定,将显示所有类别
* All category links are shown
* All category links are shown
*显示所有类别链接
* Puts a line break after the link item
* Puts a line break after the link item
*在链接item后面放置一个行分隔符
* Puts a space between the image and link (if one is included)
* Puts a space between the image and link (if one is included)
*在图像和链接之间放置一个空格(如果包含了图像的话)
* Shows link images if available
* Shows link images if available
*如果有链接图像的话,显示链接图像
* List sorted by ID
* List sorted by ID
*根据ID分类的列表
* Shows the link description
* Shows the link description
*显示链接描述
* Does not show the rating
* Does not show the rating
*不显示等级级别
* With no limit listed, it shows all links
* With no limit listed, it shows all links
*不列出限制,显示所有链接
* Does not show the updated timestamp
* Does not show the updated timestamp
*不显示更新的时间


  <?php wp_get_linksbyname(); ?>
  <?php wp_get_linksbyname(); ?>
<?php wp_get_linksbyname(); ?>


List all links in the Link Category called "Favorites".
List all links in the Link Category called "Favorites".
在称为"最喜爱"的链接类别中,列出所有链接。
<?php wp_get_linksbyname('Favorites') ?>


<?php wp_get_linksbyname('Favorites') ?>
<?php wp_get_linksbyname('Favorites') ?>


List all links in the Link Category ''Blogroll'', order the links by name, don't show the description, and show last update timestamp.
List all links in the Link Category ''Blogroll'', order the links by name, don't show the description, and show last update timestamp.
 
 
在链接类别''友情链接''中列出所有链接,根据链接名称给链接分类,不显示描述,而且显示最后更新的时间。
 
  <?php wp_get_linksbyname('Blogroll','orderby=name&show_description=0&show_updated=1') ?>
  <?php wp_get_linksbyname('Blogroll','orderby=name&show_description=0&show_updated=1') ?>
<?php wp_get_linksbyname('Blogroll','orderby=name&show_description=0&show_updated=1') ?>


== Parameters ==
== Parameters ==
===category===
===category===
== 参数 ==
===类别===
; category : (''string'') The name of the category whose links will be displayed. No default.
; category : (''string'') The name of the category whose links will be displayed. No default.
;类别:(''string'')将要显示的链接的类别的名称。没有默认设置。
===arguments===
===arguments===
===参数===
; before : (''string'') Text to place before each link. There is no default.
; before : (''string'') Text to place before each link. There is no default.
;之前:(''string'')每个链接之前放置的文本。没有默认设置。
; after : (''string'') Text to place after each link. Defaults to <tt>'&lt;br /&gt;'</tt>.
; after : (''string'') Text to place after each link. Defaults to <tt>'&lt;br /&gt;'</tt>.
;之后:(''string'')每个链接之后放置的文本。默认为<tt>'&lt;br /&gt;'</tt>。
; between : (''string'') Text to place between each link/image and its description. Defaults to <tt>' '</tt> (space).
; between : (''string'') Text to place between each link/image and its description. Defaults to <tt>' '</tt> (space).
; 之间: (''string'')每个链接/图像和各自的描述之间放置的文本。默认为<tt>' '</tt>(空格)。
; show_images : (''boolean'') Should images for links be shown.
; show_images : (''boolean'') Should images for links be shown.
;显示_图像:(''boolean'')链接的图像是否应该显示。
:* <tt>1</tt> (True - default)
:* <tt>1</tt> (True - default)
:* <tt>0</tt> (False)
:* <tt>0</tt> (False)
; orderby : (''string'') Value to sort links on. Valid options:
; orderby : (''string'') Value to sort links on. Valid options:
:* <tt>1</tt> (正确的 – 默认)
:* <tt>0</tt> (错误的)
; 顺序 : (''string'') 给链接分类的参数值。有效的选项:
:* <tt>'id'</tt> (default)
:* <tt>'id'</tt> (default)
:* <tt>'url'</tt>
:* <tt>'url'</tt>
第63行: 第133行:
:* <tt>'rss'</tt>
:* <tt>'rss'</tt>
:* <tt>'length'</tt> - The length of the link name, shortest to longest.
:* <tt>'length'</tt> - The length of the link name, shortest to longest.
:* <tt>'id'</tt>
:* <tt>'url'</tt>
:* <tt>'名称'</tt>
:* <tt>'目标'</tt>
:* <tt>'类别'</tt>
:* <tt>'描述'</tt>
:* <tt>'所有者'</tt> - 通过链接管理器添加链接的用户。
:* <tt>'等级级别'</tt>
:* <tt>'更新的'</tt>
:* <tt>'rel'</tt> - 链接关系 (XFN).
:* <tt>'注意'</tt>
:* <tt>'rss'</tt>
:* <tt>'长度'</tt> - 链接名的长度,从最短到最长不等。
: '''Prefixing any of the above options with an underscore (ex: '''<tt>'_id'</tt>''') sorts links in reverse order.'''
: '''Prefixing any of the above options with an underscore (ex: '''<tt>'_id'</tt>''') sorts links in reverse order.'''
: '''将以上的任何选项加上一个下滑线的前缀(例如: '''<tt>'_id'</tt>''')以相反的顺序给链接分类。'''
:* <tt>'rand'</tt> - Display links in random order.
:* <tt>'rand'</tt> - Display links in random order.
:* <tt>'rand'</tt> -以任意的顺序显示链接。
; show_description : (''boolean'') Display the description. Valid if '''show_images''' is <tt>FALSE</tt> or an image is not defined.  
; show_description : (''boolean'') Display the description. Valid if '''show_images''' is <tt>FALSE</tt> or an image is not defined.  
; show_description : (''boolean'')显示描述。如果'''show_images'''是<tt>错误的</tt>,或者没有定义一个图像的时候,是有效的。
:* <tt>1</tt> (True - default)
:* <tt>1</tt> (True - default)
:* <tt>0</tt> (False)
:* <tt>0</tt> (False)
:* <tt>1</tt> (正确的 – 默认)
:* <tt>0</tt> (错误的)
; show_rating : (''boolean'') Should rating stars/characters be displayed.
; show_rating : (''boolean'') Should rating stars/characters be displayed.
; show_rating : (''boolean'')等级级别stars/字符是否应该显示。
:* <tt>1</tt> (True)
:* <tt>1</tt> (True)
:* <tt>0</tt> (False - default)
:* <tt>0</tt> (False - default)
:* <tt>1</tt> (正确的)
:* <tt>0</tt> (错误的 – 默认)
; limit : (''integer'') Maximum number of links to display. Defaults to <tt>-1</tt> (all links).
; limit : (''integer'') Maximum number of links to display. Defaults to <tt>-1</tt> (all links).
;限制:(''整数'')最多可以显示的链接的数目。默认为<tt>-1</tt> (所有链接)。
; show_updated : (''boolean'') Should the last updated timestamp be displayed.  
; show_updated : (''boolean'') Should the last updated timestamp be displayed.  
; show_updated : (''boolean'')是否应该显示最后一次更新的时间。
:* <tt>1</tt> (True)
:* <tt>1</tt> (True)
:* <tt>0</tt> (False - default)
:* <tt>0</tt> (False - default)
:* <tt>1</tt> (正确的)
:* <tt>0</tt> (错误的 – 默认)
; echo : (''boolean'') Display the Links list (1 - true) or return the list to be used in PHP (0 - false). Defaults to 1.
; echo : (''boolean'') Display the Links list (1 - true) or return the list to be used in PHP (0 - false). Defaults to 1.
; echo : (''boolean'')显示链接列表(1-正确的)或者将列表返回用于PHP中(0-错误的)。默认为1。
:* <tt>1</tt> (True - default)
:* <tt>1</tt> (True - default)
:* <tt>0</tt> (False)
:* <tt>0</tt> (False)
:* <tt>1</tt> (正确的 – 默认)
:* <tt>0</tt> (错误的)


== Related ==
== Related ==
第84行: 第216行:


{{Tag Footer}}
{{Tag Footer}}
== 相关的==
{{标签链接管理器标签}}
{{标签页底文字}}

2008年7月8日 (二) 14:22的版本

模板:Deprecated

Description


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists.


描述

Displays links associated with the named link category. This tag uses the settings you specify in the WordPress:Links Manager. For control over the formatting and display of your links within the tag's parameters, see get_linksbyname().

显示与命名后的链接类别相关的链接。这个标签使用了你在链接管理器中规定的设置。归于在标签的参数内控制你的链接的格式和显示方式,请看看get_linksbyname()

Replace With

取代

wp_list_bookmarks().

wp_list_bookmarks().

Usage

用法

%%% <?php wp_get_linksbyname('category','arguments'); ?> %%%

%%% <?php wp_get_linksbyname('category','arguments'); ?> %%%

Examples

Default Usage

例子

默认用法

By default, the tag shows:

默认情况下,标签显示:

  • All categories if none are specified
  • 如果没有特别规定,将显示所有类别
  • All category links are shown
  • 显示所有类别链接
  • Puts a line break after the link item
  • 在链接item后面放置一个行分隔符
  • Puts a space between the image and link (if one is included)
  • 在图像和链接之间放置一个空格(如果包含了图像的话)
  • Shows link images if available
  • 如果有链接图像的话,显示链接图像
  • List sorted by ID
  • 根据ID分类的列表
  • Shows the link description
  • 显示链接描述
  • Does not show the rating
  • 不显示等级级别
  • With no limit listed, it shows all links
  • 不列出限制,显示所有链接
  • Does not show the updated timestamp
  • 不显示更新的时间
<?php wp_get_linksbyname(); ?>

<?php wp_get_linksbyname(); ?>

List all links in the Link Category called "Favorites". 在称为"最喜爱"的链接类别中,列出所有链接。

<?php wp_get_linksbyname('Favorites') ?>

<?php wp_get_linksbyname('Favorites') ?>

List all links in the Link Category Blogroll, order the links by name, don't show the description, and show last update timestamp.

在链接类别友情链接中列出所有链接,根据链接名称给链接分类,不显示描述,而且显示最后更新的时间。

<?php wp_get_linksbyname('Blogroll','orderby=name&show_description=0&show_updated=1') ?>

<?php wp_get_linksbyname('Blogroll','orderby=name&show_description=0&show_updated=1') ?>

Parameters

category

参数

类别

category
(string) The name of the category whose links will be displayed. No default.

;类别:(string)将要显示的链接的类别的名称。没有默认设置。

arguments

参数

before
(string) Text to place before each link. There is no default.

;之前:(string)每个链接之前放置的文本。没有默认设置。

after
(string) Text to place after each link. Defaults to '<br />'.

;之后:(string)每个链接之后放置的文本。默认为'<br />'

between
(string) Text to place between each link/image and its description. Defaults to ' ' (space).
之间
(string)每个链接/图像和各自的描述之间放置的文本。默认为' '(空格)。
show_images
(boolean) Should images for links be shown.

;显示_图像:(boolean)链接的图像是否应该显示。

  • 1 (True - default)
  • 0 (False)
orderby
(string) Value to sort links on. Valid options:


  • 1 (正确的 – 默认)
  • 0 (错误的)
顺序
(string) 给链接分类的参数值。有效的选项:
  • 'id' (default)
  • 'url'
  • 'name'
  • 'target'
  • 'category'
  • 'description'
  • 'owner' - User who added link through Links Manager.
  • 'rating'
  • 'updated'
  • 'rel' - Link relationship (XFN).
  • 'notes'
  • 'rss'
  • 'length' - The length of the link name, shortest to longest.


  • 'id'
  • 'url'
  • '名称'
  • '目标'
  • '类别'
  • '描述'
  • '所有者' - 通过链接管理器添加链接的用户。
  • '等级级别'
  • '更新的'
  • 'rel' - 链接关系 (XFN).
  • '注意'
  • 'rss'
  • '长度' - 链接名的长度,从最短到最长不等。
Prefixing any of the above options with an underscore (ex: '_id') sorts links in reverse order.
将以上的任何选项加上一个下滑线的前缀(例如: '_id')以相反的顺序给链接分类。
  • 'rand' - Display links in random order.
  • 'rand' -以任意的顺序显示链接。
show_description
(boolean) Display the description. Valid if show_images is FALSE or an image is not defined.
show_description
(boolean)显示描述。如果show_images错误的,或者没有定义一个图像的时候,是有效的。
  • 1 (True - default)
  • 0 (False)
  • 1 (正确的 – 默认)
  • 0 (错误的)


show_rating
(boolean) Should rating stars/characters be displayed.


show_rating
(boolean)等级级别stars/字符是否应该显示。


  • 1 (True)
  • 0 (False - default)


  • 1 (正确的)
  • 0 (错误的 – 默认)


limit
(integer) Maximum number of links to display. Defaults to -1 (all links).


;限制:(整数)最多可以显示的链接的数目。默认为-1 (所有链接)。


show_updated
(boolean) Should the last updated timestamp be displayed.


show_updated
(boolean)是否应该显示最后一次更新的时间。


  • 1 (True)
  • 0 (False - default)
  • 1 (正确的)
  • 0 (错误的 – 默认)


echo
(boolean) Display the Links list (1 - true) or return the list to be used in PHP (0 - false). Defaults to 1.
echo
(boolean)显示链接列表(1-正确的)或者将列表返回用于PHP中(0-错误的)。默认为1。


  • 1 (True - default)
  • 0 (False)
  • 1 (正确的 – 默认)
  • 0 (错误的)

Related

模板:Tag Link Manager Tags

模板:Tag Footer


相关的

模板:标签链接管理器标签

模板:标签页底文字