A WordPress bookmark is a saved link. It is part of the classic Links feature (also called the blogroll). Each bookmark has a name, a URL, and an optional description. You can put bookmarks in link categories.
The Links screen is hidden on new WordPress sites. Install the Link Manager plugin to add and edit links in the admin area. Bookmarks are stored in the wp_links table.
Syntax
Syntax
The four main bookmark functions:
WordPress
<?php
$link = get_bookmark( 2 ); // one link by ID
$name = get_bookmark_field( 'link_name', 2 ); // one field of a link
$links = get_bookmarks( array( 'limit' => 5 ) ); // many links
wp_list_bookmarks(); // print an HTML list
?>
A bookmark is a saved link in the classic WordPress Links feature. It has a name, a URL, an optional description, and a link category. Many sites used it for a blogroll.
Use the Links screen in the admin area. The Links menu is hidden on new sites. Install the Link Manager plugin to bring it back.
Use it when you know the link ID and need that one link. It returns an object, an array, or null.
Use it when you need a list of links that you want to loop over yourself. You can sort, limit, and filter by link category.
Use it when you want WordPress to print a ready-made HTML list of links. It can group the links by link category.