Template tags are the core set of user functions designed to display or return information dynamically for your WordPress blog. Below is a list of these tags, sorted by function-specific category.
For further information on template tags and WordPress templates in general, see the WordPress templates and themes reference at: http://codex.wordpress.org/Templates
- the_author
<?php the_author('idmode', display); ?>
Displays or returns the name of the author for a post. This tag must be used within The Loop.
Parameters
- idmode
- (string) Sets the element of a user's profile to show. Possible values:
- 'nickname'
- 'login'
- 'firstname'
- 'lastname'
- 'namefl' (format: firstname lastname)
- 'namelf' (format: lastname firstname)
- Note: Default is the selection for the Identity on blog: field in a user's (i.e. author's) profile settings. This is also used when idmode is '' (an empty value).
- display
- (boolean) Display the name (TRUE), or return it for use in PHP (FALSE). Default is TRUE.
- the_author_firstname
<?php the_author_firstname(); ?>
Displays the first name for the author of a post; the name is set in the user's profile. This tag must be used within The Loop.
- the_author_lastname
<?php the_author_lastname(); ?>
Displays the last name for the author of a post; the name is set in the user's profile. This tag must be used within The Loop.
- the_author_nickname
<?php the_author_nickname(); ?>
Displays the nickname for the author of a post; the name is set in the user's profile. This tag must be used within The Loop.
- the_author_email
<?php the_author_email(); ?>
Displays the email address for the author's of a post; the address is set in the user's profile. This tag must be used within The Loop.
- the_author_url
<?php the_author_url(); ?>
Displays the URL to the web site for the author of a post; the address is set in the user's profile. This tag must be used within The Loop.
- the_author_description
<?php the_author_description(); ?>
Displays the content of the Profile: field in a user's profile for the author of a post. The Profile is a block of text often used to describe the user, and can be quite large. This tag must be used within The Loop.
- the_author_aim
<?php the_author_aim(); ?>
Displays the AIM screen name for the author of a post; the screen name is set in the user's profile. This tag must be used within The Loop.
- the_author_icq
<?php the_author_icq(); ?>
Displays the ICQ number for the author of a post; the number is set in the user's profile. This tag must be used within The Loop.
- the_author_msn
<?php the_author_msn(); ?>
Displays the MSN IM ID for the author of a post; the ID is set in the user's profile. This tag must be used within The Loop.
- the_author_yim
<?php the_author_yim(); ?>
Displays the Yahoo IM ID for the author of a post; the ID is set in the user's profile. This tag must be used within The Loop.
- the_author_login
<?php the_author_login(); ?>
Displays the login name for the author of a post. The login is the username an author uses to access WordPress. This tag must be used within The Loop.
- the_author_ID
<?php the_author_ID(); ?>
Displays the unique numeric user ID for the author of a post; the ID is assigned by WordPress when a user account is created. This tag must be used within The Loop.
- the_author_posts
<?php the_author_posts(); ?>
Displays the total number of posts an author has created. This tag must be used within The Loop.
- the_author_posts_link
<?php the_author_posts_link('idmode'); ?>
Displays a link to all posts by an author. The link text is determined by the idmode parameter (see below). This tag must be used within The Loop.
Parameters
- idmode
- (string) Selects the element of a user's profile to use for link text. Possible values:
- 'nickname'
- 'login'
- 'firstname'
- 'lastname'
- 'namefl' (format: firstname lastname)
- 'namelf' (format: lastname firstname)
- Note: Default is the selection for the Identity on blog: field in a user's (i.e. author's) profile settings. This is also used when idmode is '' (an empty value).
- list_authors
<?php list_authors(optioncount, exclude_admin, show_fullname, hide_empty, 'feed', 'feed_image'); ?>
Displays a list of the authors on a blog, and if desired, other information such as a link to each author's RSS feed. This tag behaves like wp_list_authors, the difference being that arguments are passed to the function in PHP-function style format.
Parameters
- optioncount
- (boolean) Display number of posts by each author. Options are:
- exclude_admin
- (boolean) Exclude the administrator account from authors list. Options are:
- show_fullname
- (boolean) Display the full (first and last) name of the authors. Options are:
- hide_empty
- (boolean) Do not display authors with 0 posts. Options are:
- feed
- (string) Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
- feed_image
- (string) Path/filename for a graphic. This acts as a link to each author's RSS feed, and overrides the feed parameter.
- wp_list_authors
<?php wp_list_authors('arguments'); ?>
Displays a list of the blog's authors, and optionally displays each author's post count and RSS feed link. This tag behaves like list_authors, the difference being that arguments are passed to the function in query string format.
Parameters
- optioncount
- (boolean) Display number of posts by each author. Options are:
- 1 (true)
- 0 (false - this is the default)
- exclude_admin
- (boolean) Exclude the administrator account from authors list. Options are:
- 1 (true - this is the default)
- 0 (false)
- show_fullname
- (boolean) Display the full (first and last) name of the authors. Options are:
- 1 (true)
- 0 (false - this is the default)
- hide_empty
- (boolean) Do not display authors with 0 posts. Options are:
- 1 (true - this is the default)
- 0 (false)
- feed
- (string) Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
- feed_image
- (string) Path/filename for a graphic. This acts as a link to each author's RSS feed, and overrides the feed parameter.
- the_category
<?php the_category('separator', 'parents' ); ?>
Displays a link to the category or categories a post belongs to. This tag must be used within The Loop.
Parameters
- separator
- (string) Text or character to display between each category link. The default is to place the links in an unordered list.
- parents
- (string) How to display links that reside in child (sub) categories. Options are:
- 'multiple' - Display separate links to parent and child categories, exhibiting "parent/child" relationship.
- 'single' - Display link to child category only, with link text exhibiting "parent/child" relationship.
- Note: Default is a link to the child category, with no relationship exhibited.
- the_category_ID (Deprecated)
<?php the_category_ID(echo); ?>
Displays or returns the numeric ID of the category a post belongs to. This tag must be used within The Loop.
Parameters
- echo
- (boolean) Display the category ID (TRUE) or return it for use in PHP (FALSE). Defaults to TRUE.
- the_category_head (Deprecated)
<?php the_category_head('before', 'after'); ?>
Displays the name of a category if it's different from the previous category. This tag must be used within The Loop.
Parameters
- before
- (string) Text to output before the category. Defaults to '' (no text).
- after
- (string) Text to output after the category. Defaults to '' (no text).
- single_cat_title
<?php single_cat_title('prefix', 'display'); ?>
Displays or returns the category title for the current page.
Parameters
- prefix
- (string) Text to output before the category title. Defaults to '' (no text).
- display
- (boolean) Display the category ID (TRUE) or return it for use in PHP (FALSE). Defaults to TRUE.
- category_description
<?php category_description(category); ?>
Returns the description of a category.
Parameters
- category
- (integer) The numeric category ID for which category description to return. Defaults to current category, if one is set.
- list_cats
<?php list_cats(optionall, 'all', 'sort_column', 'sort_order', 'file', list, optiondates, optioncount, hide_empty, use_desc_for_title, children, child_of, 'categories', recurse, 'feed', 'feed_img', 'exclude', hierarchical); ?>
Displays a list of categories as links. This works like the wp_list_cats tag, except that this one uses the PHP function-style arguments.
Parameters
- optionall
- (boolean) Sets whether to have an option to display all categories. Valid values:
- all
- (string) Text to display for the option to display all categories. Defaults to 'All'.
- sort_column
- (string) Key to sort options by. Valid values:
- sort_order
- (string) Sort order for options. Valid values:
- file
- (string) The php file a category link is to be displayed on. Defaults to 'index.php'.
- list
- (boolean) Sets whether the categories are enclosed in an unordered list (<ul><li>). Valid values:
- optiondates
- (boolean) Sets whether to display the date of the last post in each category. Valid values:
- optioncount
- (boolean) Sets whether to display a count of posts in each category. Valid values:
- hide_empty
- (boolean) Sets whether to hide (not display) categories with no posts. Valid values:
- use_desc_for_title
- (boolean) Sets whether the category description is displayed as link title (i.e. <a title="Category Description" href="...). Valid values:
- children
- (boolean) Sets whether to show children (sub) categories. Valid values:
- child_of
- (integer) Display only the categories that are children of this category (ID number). There is no default.
- categories
- (integer) This parameter should be set to 0 (zero) when calling this template tag. (For the curious, other values are used only internally by the tag when generating a hierarchical list.)
- recurse
- (boolean) Display the list (FALSE) or return it for use in PHP (TRUE). Defaults to FALSE.
- feed
- (string) Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
- feed_img
- (string) Path/filename for a graphic to act as a link to each categories' RSS feed. Overrides the feed parameter.
- exclude
- (string) Sets the categories to be excluded. This must be in the form of an array (ex: '1, 2, 3').
- hierarchical
- (boolean) Sets whether to display child (sub) categories in a hierarchical (after parent) list. Valid values:
- wp_list_cats
<?php wp_list_cats('arguments'); ?>
Displays a list of categories as links. This works in much the same way as list_cats(), the difference being that arguments are given in query string format.
Parameters
- optionall
- (boolean) Sets whether to have an option to display all categories. Valid values:
- 1 (True)
- 0 (False - default)
- all
- (string) Text to display for the option to display all categories. Defaults to All.
- sort_column
- (string) Key to sort options by. Valid values:
- sort_order
- (string) Sort order for options. Valid values:
- file
- (string) The php file a category link is to be displayed on. Defaults to index.php.
- list
- (boolean) Sets whether the categories are enclosed in an unordered list (<ul><li>). Valid values:
- 1 (True - default)
- 0 (False)
- optiondates
- (boolean) Sets whether to display the date of the last post in each category. Valid values:
- 1 (True)
- 0 (False - default)
- optioncount
- (boolean) Sets whether to display a count of posts in each category. Valid values:
- 1 (True)
- 0 (False - default)
- hide_empty
- (boolean) Sets whether to hide (not display) categories with no posts. Valid values:
- 1 (True - default)
- 0 (False)
- use_desc_for_title
- (boolean) Sets whether the category description is displayed as link title (i.e. <a title="Category Description" href="...). Valid values:
- 1 (True - default)
- 0 (False)
- children
- (boolean) Sets whether to show children (sub) categories. Valid values:
- 1 (True - default)
- 0 (False)
- child_of
- (integer) Display only the categories that are children of this category (ID number). There is no default.
- feed
- (string) Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
- feed_img
- (string) Path/filename for a graphic to act as a link to each categories' RSS feed. Overrides the feed parameter.
- exclude
- (string) Sets the categories to be excluded. This must be in the form of an array (ex: 1, 2, 3).
- hierarchical
- (boolean) Sets whether to display child (sub) categories in a hierarchical (after parent) list. Valid values:
- 1 (True - default)
- 0 (False)
- dropdown_cats
<?php dropdown_cats(optionall, 'all', 'sort_column', 'sort_order', optiondates, optioncount, hide_empty, optionnone, selected, hide); ?>
Displays a list of categories in a select (i.e. dropdown) box.
Parameters
- optionall
- (boolean) Sets whether to have an option to display all categories. Valid values:
- all
- (string) Text to display for the option to display all categories. Defaults to 'All'.
- sort_column
- (string) Key to sort options by. Valid values:
- sort_order
- (string) Sort order for options. Valid values:
- optiondates
- (boolean) Sets whether to display the date of the last post in each category. Valid values:
- optioncount
- (boolean) Sets whether to display a count of posts in each category. Valid values:
- hide_empty
- (boolean) Sets whether to hide (not display) categories with no posts. Valid values:
- optionnone
- (boolean) Sets whether to have an option to display none of the categories. Valid values:
- selected
- (integer) Sets the default selected category ID number. Defaults to current category.
- hide
- (integer) Do not display this category (specified by category ID number). There is no default.
- get_category_parents
<?php echo(get_category_parents(category, display link, separator)); ?>
Returns a list of the parents of a category, including the category, sorted by ID.
Parameters
- category
- (integer) The numeric category ID for which to return the parents. Defaults to current category, if one is set.
- the_date
<?php the_date('format', 'before', 'after', echo); ?>
Displays or returns the date of a post. For two or more posts displayed that exist under the same date, the tag only displays the date the first time it's called. This tag must be used within The Loop.
Parameters
- format
- (string) The format for the date. Defaults to the date format configured in your WordPress options. See Formatting Date and Time.
- before
- (string) Text to place before the date. There is no default.
- after
- (string) Text to place after the date. There is no default.
- echo
- (boolean) Display the date (TRUE), or return the date to be used in PHP (FALSE). Defaults to TRUE.
- the_date_xml
<?php the_date_xml(); ?>
Displays the date of the post in YYYY-MM-DD format (ex: 2004-09-24). This tag must be used within The Loop.
- the_time
<?php the_time('format'); ?>
Displays the time of the current post. This tag must be used within The Loop.
Parameters
- format
- (string) The format the time is to display in. Defaults to the time format configured in your WordPress options. See Formatting Date and Time.
- get_the_time
<?php get_the_time('format'); ?>
Returns the time of the current post for use in PHP. It does not display the time. This tag must be used within The Loop.
Parameters
- format
- (string) The format the time is to display in. Defaults to the time format configured in your WordPress options. See Formatting Date and Time.
- single_month_title
<?php single_month_title('prefix', display) ?>
Displays or returns the month and year title for the current page. This tag only works when the internal archive month argument is passed by WordPress to the current page (this occurs when viewing a monthly archive page).
Parameters
- prefix
- (string) Text to place before the title. There is no default.
- display
- (boolean) Display the title (TRUE), or return the title to be used in PHP (FALSE). Defaults to TRUE.
- the_weekday (Deprecated)
<?php the_weekday() ?>
Displays the day of the week (e.g. Friday). This tag must be used within The Loop.
- the_weekday_date (Deprecated)
<?php the_weekday_date('before', 'after') ?>
Displays the weekday of the current post (e.g. Friday) only if it is different from the weekday of the previous post. This tag must be used within The Loop.
Parameters
- before
- (string) Text placed before the tag's output. There is no default.
- after
- (string) Text placed after the tag's output. There is no default.
- bloginfo
<?php bloginfo('show'); ?>
Displays information about your blog. Can be used anywhere within a page template.
Parameters
- show
- (string) Informational detail about your blog. Valid values:
- 'name' - Weblog title; set in General Options. (Default)
- 'description' - Tag line for your blog; set in General Options.
- 'url' - URL for your blog's web site address.
- 'rdf_url' - URL for RDF/RSS 1 feed.
- 'rss_url' - URL for RSS 0.92 feed.
- 'rss2_url' - URL for RSS 2.0 feed.
- 'atom_url' - URL for Atom feed.
- 'comments_rss2_url' - URL for comments RSS 2.0 feed.
- 'pingback_url' - URL for Pingback (XML-RPC file).
- 'admin_email' - Administrator's email address; set in General Options.
- 'charset' - Character encoding for your blog; set in Reading Options.
- 'version' - Version of WordPress your blog uses.
- 'wpurl' - URL for WordPress installation.
- 'template_url' - URL for template in use.
- 'template_directory' - URL for template's directory.
- 'stylesheet_url' - URL for primary CSS file.
- 'stylesheet_directory' - URL for stylesheet directory.
- wp_title
<?php wp_title('sep', display); ?>
Displays or returns the title of the page. This tag can be placed anywhere within a template, though is typically used in the <title> tag for the head of a page. Page title always includes the blog name. If viewing a post, it includes the title of the post; if viewing an archive page, it includes the year and month for the archive; if viewing a category, it includes the category name.
Parameters
- sep
- (string) Text to display between portions of the title (i.e. the separator), such as blog and category name. Defaults to '»' (»).
- display
- (boolean) Display the page title (TRUE), or return it for use in PHP (FALSE). Defaults to TRUE.
- get_archives
<?php get_archives('type', 'limit', 'format', 'before', 'after', show_post_count); ?>
Displays a list of links to date-based archives. This tag is similar to wp_get_archives(), the difference being parameter arguments are given in PHP-function style format. This tag can be used anywhere within a template.
Parameters
- type
- (string) The type of archive links to display. Valid values:
- 'monthly' (Default)
- 'daily'
- 'weekly'
- 'postbypost'
- limit
- (integer) Number of archives to get. Use '' for no limit.
- format
- (string) Format for the archive list. Valid values:
- 'html' - In HTML list (<li>) tags. This is the default.
- 'option' - In select or dropdown option (<option>) tags.
- 'link' - Within link (<link>) tags.
- 'custom' - Custom list.
- before
- (string) Text to place before the link when using 'custom' or 'html' for format option. Defaults to ''.
- after
- (string) Text to place after the link when using 'custom' or 'html' for format option. Defaults to ''.
- show_post_count
- (boolean) Display number of posts in an archive (TRUE) or do not (FALSE). For use when type is set to 'monthly'. Defaults to FALSE.
- wp_get_archives
<?php wp_get_archives('arguments'); ?>
Displays a list of links to date-based archives. This tag is similar to get_archives(), the difference being parameter arguments are given in query string format. This tag can be used anywhere within a template.
Parameters
- type
- (string) The type of archive links to display. Valid values:
- monthly (Default)
- daily
- weekly
- postbypost
- limit
- (integer) Number of archives to get. Default is no limit.
- format
- (string) Format for the archive list. Valid values:
- html - In HTML list (<li>) tags. This is the default.
- option - In select or dropdown option (<option>) tags.
- link - Within link (<link>) tags.
- custom - Custom list.
- before
- (string) Text to place before the link when using custom or html for format option. There is no default.
- after
- (string) Text to place after the link when using custom or html for format option. There is no default.
- show_post_count
- (boolean) Display number of posts in an archive (1 - true) or do not (0 - false). For use when type is set to monthly. Defaults to 0.
- get_calendar
<?php get_calendar(daylength); ?>
Displays the calendar for the last month with any posts in it. This tag can be used anywhere within a template.
Parameters
- daylength
- (integer) Length of abbreviations for the days of the week. For example, 1 causes Sunday to be displayed as "S", 2 will causes it to expand to "Sun". Defaults to 1. Any value other than 1 will display abbreviation based on your WordPress Localization.
- wp_list_pages
<?php wp_list_pages('arguments'); ?>
Displays a nested, unordered HTML list of all the Pages you have created under Write → Pages in your Administration Panels.
Parameters
- child_of
- (integer) Display only the subpages of the Page; use the numeric ID for a Page as the value. Defaults to 0 (display all pages).
- sort_column
- (string) Sort Page list by one of the following options:
- post_title - Sort alphabetically by Page/post title (Default).
- menu_order - Sort by Page Order (specified under a Page entry in Manage → Pages).
- time_created - Sort by creation time.
- time_modified - Sort by time last modified.
- ID - Sort by numeric Page ID.
- post_author - Sort by author numeric ID.
- post_name - Sort alphabetically by Page slug.
- sort_order
- (string) Sort order for options. Valid values:
- ASC - Sort from lowest to highest (Default).
- DESC - Sort from highest to lowest.
- exclude
- (string) Comma separated list of Page numeric IDs to be excluded from the list (example: exclude=10, 20, 30). There is no default value.
- depth
- (integer) Numeric value for how many levels of hierarchy (sub-pages) to display. Defaults to 0 (display all pages).
- show_date
- (string) Display creation or last modified date next to each Page. Valid values:
- - An empty value; display no date (Default).
- modified - Display the date last modified.
- created - Display the creation date.
- date_format
- (string) Format of date to display. Defaults to the date format configured in your WordPress options. See Formatting Date and Time.
- title_li
- (string) Text for the heading of the Page list. Defaults to __(Pages), which displays "Pages" (the __() is used for localization purposes). If passed a null or empty value, no heading is displayed, and the list will not be wrapped in <ul><li>, </li></ul> tags.
- wp_loginout
<?php wp_loginout(); ?>
Displays a login link, or if a user is logged in, a logout link.
- wp_register
<?php wp_register('before', 'after'); ?>
Parameters
- before
- (string) Text to display before the Register/Site Admin link. Default is '<li>'.
- after
- (string) Text to display after the Register/Site Admin link. Default is '</li>'.
- query_posts
- edit_post_link
<?php edit_post_link('text', 'before', 'after'); ?>
Displays a link to edit the current post, if a user is logged in and allowed to edit the post. It must be within The Loop.
Parameters
- text
- (string) The link text. Defaults to 'Edit This'.
- before
- (string) Text to put before the link text. There is no default.
- after
- (string) Text to put after the link text. There is no default.
- posts_nav_link
<?php posts_nav_link('separator', 'prelabel', 'nextlabel'); ?>
Displays links for next and previous pages. Useful for providing "paged" navigation of index, category and archive pages.
Parameters
- separator
- (string) Text displayed between the links. Defaults to ' — '.
- prelabel
- (string) Link text for the previous page. Defaults to '« Previous Page'.
- nextlabel
- (string) Link text for the next page. Defaults to 'Next Page »'.
- link_pages
<?php link_pages('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); ?>
Displays page-links for paginated posts. This is similar to wp_link_pages(), the difference being that arguments are given in PHP-function style format. This tag must be within The Loop.
Parameters
- before
- (string) Text to put before all the links. Defaults to '<br />'.
- after
- (string) Text to put after all the links. Defaults to '<br />'.
- next_or_number
- (string) Indicates whether page numbers should be used. Valid values are:
- 'number' (Default)
- 'next'.
- nextpagelink
- (string) Text for link to next page. Defaults to 'next page'
- previouspagelink
- (string) Text for link to previous page. Defaults to 'previous page'.
- pagelink
- (string) Format string for page numbers. '%' in the string will be replaced with the number, so 'Page %' would generate "Page 1", "Page 2", etc. Defaults to '%'.
- more_file
- (string) Page the links should point to. Defaults to the current page.
- wp_link_pages
<?php wp_link_pages('arguments'); ?>
Displays page-links for paginated posts. This is similar to link_pages(), the difference being that arguments are given in query string format. This tag must be within The Loop.
Parameters
- before
- (string) Text to put before all the links. Defaults to <p>Pages:.
- after
- (string) Text to put after all the links. Defaults to </p>.
- next_or_number
- (string) Indicates whether page numbers should be used. Valid values are:
- nextpagelink
- (string) Text for link to next page. Defaults to Next page.
- previouspagelink
- (string) Text for link to previous page. Defaults to Previous page.
- pagelink
- (string) Format string for page numbers. % in the string will be replaced with the number, so Page % would generate "Page 1", "Page 2", etc. Defaults to %.
- more_file
- (string) Page the links should point to. Defaults to the current page.
- get_year_link
<?php get_year_link('year'); ?>
Returns the yearly archive URL to a specific year for use in PHP. It does NOT display the URL. If year is set to '', the tag returns the URL for the current year's archive.
Parameters
- year
- (integer) The year for the archive. Use '' to assign current year.
- get_month_link
<?php get_month_link('year', 'month'); ?>
Returns the monthly archive URL to a specific year and month for use in PHP. It does NOT display the URL. If year and month parameters are set to '', the tag returns the URL for the current month's archive.
Parameters
- year
- (integer) The year for the archive. Use '' to assign current year.
- month
- (integer) The month for archive. Use '' to assign current month.
- get_day_link
<?php get_day_link('year', 'month', 'day'); ?>
Returns the daily archive URL to a specific year, month and day for use in PHP. It does NOT display the URL. If year, month and day parameters are set to '', the tag returns the URL for the current day's archive.
Parameters
- year
- (integer) The year for the archive. Use '' to assign current year.
- month
- (integer) The month for archive. Use '' to assign current month.
- day
- (integer) The day for archive. Use '' to assign current day.
- get_links_list
<?php get_links_list('order'); ?>
Displays a nested HTML unordered list of all links as defined in the Links Manager, sorted under link category headings.
Parameters
- order
- (string) Value to sort link categories by. Valid values:
- Note: Prefixing the above options with an underscore (ex: '_id') sorts links in reverse order.
- get_links
<?php get_links(category, 'before', 'after', 'between', show_images, 'order', show_description, show_rating, limit, show_updated, echo); ?>
Like wp_get_links(), this tag displays links from the Links Manager, but allows the user to control how they are displayed by tag parameters, rather than through the WordPress admin interface (useful when displaying links on more than one template).
Parameters
- category
- (integer) The numeric ID of the link category whose links will be displayed. If none is specified, all links are shown. Defaults to -1 (all links).
- before
- (string) Text to place before each link. There is no default.
- after
- (string) Text to place after each link. Defaults to '<br />'.
- between
- (string) Text to place between each link/image and its description. Defaults to ' ' (space).
- show_images
- (boolean) Should images for links be shown (TRUE) or not (FALSE). Defaults to TRUE.
- orderby
- (string) Value to sort links on. Defaults to 'name' unless you pass the value of '' (empty), in which case it sets to 'id'. Valid options:
- 'id'
- 'url'
- 'name'
- 'target'
- 'category'
- 'description'
- 'owner' - User who added link through Links Manager.
- 'rating'
- 'updated'
- 'rel' - Link relationship (XFN).
- 'notes'
- 'rss'
- Note: Prefixing the above options with an underscore (ex: '_id') sorts links in reverse order.
- 'rand' - Display links in random order.
- show_description
- (boolean) Should the description be displayed (TRUE) or not (FALSE). Valid when show_images is FALSE, or an image is not defined. Defaults to TRUE.
- show_rating
- (boolean) Should rating stars/characters be displayed (TRUE) or not (FALSE). Defaults to FALSE.
- limit
- (integer) Maximum number of links to display. Defaults to -1 (all links).
- show_updated
- (boolean) Should the last updated timestamp be displayed (TRUE) or not (FALSE). Defaults to FALSE.
- echo
- (boolean) Display links (TRUE) or return them for use PHP (FALSE). Defaults to TRUE.
- wp_get_links
<?php wp_get_links(category); ?>
Displays links associated with a numeric link category ID. This tag uses the settings you specify in the Links Manager. For control over the formatting and display of your links within the tag's parameters, see get_links().
Parameters
- category
- (integer) The numeric ID of the link category whose links will be displayed. If no link category is specified, all links are shown.
- get_linksbyname
<?php get_linksbyname('cat_name', 'before', 'after', 'between', show_images, 'orderby', show_description, show_rating, limit, show_updated); ?>
Like wp_get_linksbyname(), this tag displays links from the Links Manager, but allows the user to control how they are displayed by tag parameters, rather than through the WordPress admin interface (useful when displaying links on more than one template).
Parameters
- cat_name
- (string) The name of the link category whose links will be displayed. If none is specified, all links are shown. Defaults to 'noname' (all links).
- before
- (string) Text to place before each link. There is no default.
- after
- (string) Text to place after each link. Defaults to '<br />'.
- between
- (string) Text to place between each link/image and its description. Defaults to ' ' (space).
- show_images
- (boolean) Should images for links be shown (TRUE) or not (FALSE). Defaults to TRUE.
- orderby
- (string) Value to sort links on. Defaults to 'id'. Valid options:
- 'id'
- 'url'
- 'name'
- 'target'
- 'category'
- 'description'
- 'owner' - User who added link through Links Manager.
- 'rating'
- 'updated'
- 'rel' - Link relationship (XFN).
- 'notes'
- 'rss'
- Note: Prefixing the above options with an underscore (ex: '_id') sorts links in reverse order.
- 'rand' - Display links in random order.
- show_description
- (boolean) Display the description (TRUE) or not (FALSE). Valid if show_images is FALSE or an image is not defined. Defaults to TRUE.
- show_rating
- (boolean) Should rating stars/characters be displayed (TRUE) or not (FALSE). Defaults to FALSE.
- limit
- (integer) Maximum number of links to display. Defaults to -1 (all links).
- show_updated
- (boolean) Should the last updated timestamp be displayed (TRUE) or not (FALSE). Defaults to FALSE.
- wp_get_linksbyname
<?php wp_get_linksbyname('category'); ?>
Displays links associated with the named link category. This tag uses the settings you specify in the Link Manager. For control over the formatting and display of your links within the tag's parameters, see get_linksbyname().
Parameters
- category
- (string) The name of the category whose links will be displayed. No default.
- the_ID
<?php the_ID(); ?>
Displays the numeric ID of the current post. This tag must be within The Loop.
- the_title
<?php the_title('before', 'after', display); ?>
Displays or returns the title of the current post. This tag must be within The Loop.
Parameters
- before
- (string) Text to place before the title. Defaults to ''.
- after
- (string) Text to place after the title. Defaults to ''.
- display
- (Boolean) Display the title (TRUE) or return it for use in PHP (FALSE). Defaults to TRUE.
- single_post_title
<?php single_post_title('prefix', display); ?>
Displays or returns the title of the post when on a single post page (permalink page). This tag can be useful for displaying post titles outside The Loop.
Parameters
- prefix
- (string) Text to place before the title. Defaults to ''.
- display
- (boolean) Should the title be displayed (TRUE) or returned for use in PHP (FALSE). Defaults to TRUE.
- the_content
<?php the_content('more_link_text', strip_teaser, 'more_file'); ?>
Displays the contents of the current post. This tag must be within The Loop.
Parameters
- more_link_text
- (string) The link text to display for the "more" link. Defaults to '(more...)'.
- strip_teaser
- (boolean) Should the "more" link be hidden (TRUE) or displayed (FALSE). Defaults to FALSE.
- more_file
- (string) File the "more" link points to. Defaults to the current file.
- the_excerpt
<?php the_excerpt(); ?>
Displays the excerpt of the current post. If a post does not contain an explicit excerpt, the first 120 words of the post's content are returned. In this latter case, HTML tags and graphics are stripped from the excerpt's content. This tag must be within The Loop.
- previous_post
<?php previous_post('format', 'text', 'title', 'in_same_cat', limitprev, excluded_category); ?>
Used on single post/permalink pages, this tag lists the previous post in chronological order from the current post. It can work in conjunction with the next_post() tag. This tag must be used in The Loop.
Parameters
- format
- (string) Format string for the link. '%' in string will be replaced with the link, so 'Go to %' will generate "Go to <a href=..." Defaults to '%'.
- text
- (string) Link text to display. Defaults to 'previous post: '.
- title
- (string) Indicates whether title should be used as link text. If set to 'yes', immediately follows text (above). Options are:
- in_same_cat
- (string) Indicates whether the previous post link must be in the same category/categories as current. This is an archaic parameter (pre-1.0/multiple categories), and does not function in 1.5. Options are:
- limitprev
- (integer) Sets previous post link on numeric value of parameter (current post ID minus limitprev). Defaults to 1. Default is recommended.
- excluded_category
- (integer) Numeric category ID from which the previous post should not be listed. This is an archaic parameter (pre-1.0/multiple categories), and does not function in 1.5.
- next_post
<?php next_post('format', 'text', 'title', 'in_same_cat', limitnext, excluded_category); ?>
Used on single post/permalink pages, this tag lists the next post in chronological order from the current post. It can work in conjunction with the previous_post() tag. This tag must be used in The Loop.
Parameters
- format
- (string) Format string for the link. '%' in string will be replaced with the link, so 'Go to %' will generate "Go to <a href=..." Defaults to '%'.
- text
- (string) Link text to display. Defaults to 'next post: '.
- title
- (string) Indicates whether title should be used as link text. If set to 'yes', immediately follows text (above). Options are:
- in_same_cat
- (string) Indicates whether the next post link must be in the same category/categories as current. This is an archaic parameter (pre-1.0/multiple categories), and does not function in 1.5. Options are:
- limitnext
- (integer) Sets next post link on numeric value of parameter (current post ID plus limitnext). Defaults to 1. Default is recommended.
- excluded_category
- (integer) Numeric category ID from which the next post should not be listed. This is an archaic parameter (pre-1.0/multiple categories), and does not function in 1.5.
- the_meta
<?php the_meta(); ?>
Displays an unordered list of custom field "key:value" pairs, or the PostMeta for the current post. Must be used from within The Loop.