Function Reference/get links list

来自WordPress中文文档
跳转至: 导航搜索

wordpress.org.cn


includeonlydiv style=clear:both; background-color:#FFFFFF; border:1px solid #FFFFFF; color:#c00; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;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. See also onlyincludecodewp-includes/deprecated.php/code/onlyinclude

div class=template-description style=padding: 0 1.5em; border: 1px solid #eeeeee; background-color: #f9f9f9

Template Description

Link to the source code on http://core.trac.wordpress.org/browser/.

Parameters

  1. filename
  2. (option) path to codetag/code (version) or codetrunk/code. This option is only used for a new function.br /Default: codetrunk/code -- trunk is the latest bleeding edge development version of WordPress.

Usage

Link to the stable version: pre检查到模板循环:模板:Trac/pre

Link to trunk: pre检查到模板循环:模板:Trac/pre

/div

wordpress.org.cn./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 检查到模板循环:模板:Message /pre

Result

检查到模板循环:模板:Message

/noinclude


Description

Displays a nested HTML unordered list of all links as defined in the Links Manager, sorted under Link Category headings. Note: the Link Category headings are automatically generated inside of <h2> headings.

Note: This tag does not respect the "Before Link", "Between Link and Description", and "After Link" settings defined for Link Categories in the Links Manager, Formatting (but respect Category Options, Show, Description). To get around this feature/limitation, see Example 2 from wp_get_links().

Replace With

wp_list_bookmarks().

Usage

%%% <?php get_links_list('order'); ?> %%%

Example

Display links sorted by Link Category ID.

<?php get_links_list('id'); ?> 

Automatically generates the <li> with an ID of the Link Category wrapped in an <h2> heading. It looks like this (links edited for space):

<li id="linkcat-1"><h2>Blogroll</h2>
   <ul>
      <li><a href="http://example1.com/">Blogroll Link 1</a></li>
      <li><a href="http://example2.com/">Blogroll Link 2</a></li>
      <li><a href="http://example3.com/">Blogroll Link 3</a></li>
    </ul>
</li>

Parameters

order 
(string) Value to sort Link Categories by. Valid values:
  • 'name' (Default)
  • 'id'
Prefixing the above options with an underscore (ex: '_id') sorts links in reverse order.

Related

get_bookmark, get_bookmark_field, get_bookmarks, wp_list_bookmarks

includeonlydiv style=clear:both; background-color:#F7F7F7; border:1px solid #CCCCCC; color:#000000; padding:7px; margin:0.5em auto 0.5em auto; vertical-align:middle;See also index of Function Reference and index of Template Tags./div/includeonlynoinclude

Description

This Template is used by Codex:Template Messages.

Usage

pre 检查到模板循环:模板:Message /pre

Result

检查到模板循环:模板:Message

/noinclude