the_taxonomies

Advertisement

Summery Summery

Display the taxonomies of a post with available options.

Syntax Syntax

the_taxonomies( array $args = array() )

Description Description

This function can be used within the loop to display the taxonomies for a post without specifying the Post ID. You can also use it outside the Loop to display the taxonomies for a specific post.

Parameters Parameters

$args

(array) (Optional) Arguments about which post to use and how to format the output. Shares all of the arguments supported by get_the_taxonomies(), in addition to the following.

  • 'post'
    (int|WP_Post) Post ID or object to get taxonomies of. Default current post.
  • 'before'
    (string) Displays before the taxonomies. Default empty string.
  • 'sep'
    (string) Separates each taxonomy. Default is a space.
  • 'after'
    (string) Displays after the taxonomies. Default empty string.

Default value: array()

Source Source

File: wp-includes/taxonomy.php

	global $wp_rewrite;

	if ( ! is_object( $term ) ) {
		if ( is_int( $term ) ) {
			$term = get_term( $term, $taxonomy );
		} else {
			$term = get_term_by( 'slug', $term, $taxonomy );
		}
	}

	if ( ! is_object( $term ) ) {
		$term = new WP_Error( 'invalid_term', __( 'Empty Term.' ) );

Advertisement

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.