wp_list_bookmarks

BOOKMARK TAG

What It Does

Displays the bookmarks specified in the admin panel at Administration > Blogroll > Manage Blogroll.

Code

<?php wp_list_bookmarks(‘parameters’); ?>

The available parameters are as follows:

categorize

Display the bookmarks within their assigned categories.

  • 1 – True (default value)
  • 0 – False

category

Allows you to specify which categories to be displayed by their numerical ID, seperated by commas. If no categories are specified, all the bookmarks are displayed.

exclude_category

Allows you to specify which categories to be excluded by their numerical ID, seperated by commas. If no categories are specified, no categories will be excluded.

category_name

Similar to “category”, only this allows you to specify a specific category to include by its name.

category_before

Allows you to specify which text will be displayed before each category. By default, the following is used:

<li id=”ID” class=”linkcat”>

category_after

Allows you to specify which text will be displayed after each category. By default, the following is used:

</li>

class

Which CSS class to use for each category. As mentioned above, by default the class name “linkcat” is used.

category_orderby

Allows you to specify how the categories are ordered.

  • name – Order categories by name (default value)
  • id – Order categories by their numerical ID
  • slug – Order categories by their slug
  • count – Order categories by count

category_order

Allows you to order the categories in ascending or descending order by the “category_orderby” method specified above.

  • ASC – Ascending (default value)
  • DESC – Descending

title_li

Allows you to specify the heading text of the link list. By default, “__(‘Bookmarks’)” is used. In order for title_li to be used, categorize must be set to 0.

title_before

Allows you to specify what text to display before each category description. By default, an h2 opening tag is used.

title_after

Allows you to specify what text to display after each category description. By default, an h2 closing tag is used.

show_private

Allows you to specify whether or not to include private categories.

  • 1 – True (default value)
  • 0 – False

include

Allows you to specify which bookmarks to include specified by their numerical ID seperated by a comma. “category”, “category_name” and “exclude” are all ignored if this parameter is used. By default, all bookmarks are included.

exclude

Allows you to specify which bookmarks to exclude specified by their numerical ID seperated by a comma.

orderby

Allows you to specify in which order the bookmarks will be displayed.

  • name (default value)
  • id
  • url
  • target
  • description
  • owner
  • rating
  • updated
  • rel
  • notes
  • rss
  • length
  • rand

order

Allows you to specify which order the bookmarks will be displayed as specified in the “orderby” parameter.

  • ASC – Ascending (default value)
  • DESC – Descending

limit

The maximum number of bookmarks to be displayed. -1 is used by default which is no limit (display all).

before

Text to use before each bookmark. This defaults to:

<li>

after

Text to use after each bookmark. This defaults to:

</li>

link_before

Anchor text to display before the the bookmark text. This feature is only available with WordPress versions 2.7 and above.

link_after

Anchor text to display after the the bookmark text. This feature is only available with WordPress versions 2.7 and above.

category_before

Text to display before each category. This defaults to:

<li>

category_after

Text to display after each category. This defaults to:

</li>

between

Allows you to specify what text to use in-between each bookmark and description. A new line is added by default.

show_images

Allows you to specify whether or not images should be used for the bookmarks.

  • 1 – True (default value)
  • 0 – False

show_description

Allows you to choose whether or not to show the description.

  • 1 – True (default value)
  • 0 – False

show_name

Displays the text of a link when “TRUE”. Works only when show_images is “TRUE”. This feature is only available with WordPress versions 2.7 and above.

  • 1 – True
  • 0 – False (default value)

show_updated

Allows you to specify whether or not to display the last updated timestamp.

  • 1 – True
  • 0 – False (default value)

hide_invisible

Allows you to specify whether or not to display bookmarks whose visible setting is set to “No”.

  • 1 – True (default value)
  • 0 – False

echo

Whether to display the bookmarks or to hold them for use in PHP.

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

Example

The following example will display a list of bookmarks with the CSS class for the categories being “bookcat” and the bookmarks displayed in random order.

<?php wp_list_bookmarks(‘class=bookcat&orderby=rand’); ?>