WordPress at a glance

the_taxonomies() WP 1.0

Display the taxonomies of a post with available options.

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.

Works based on: get_the_taxonomies()
✈ 1 time = 0.009228s = very slow | 50000 times = 51.10s = very slow PHP 7.1.2, WP 4.7.3

No Hooks.

Return

Nothing (null).

Usage

the_taxonomies( $args );
$args(array)

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: space

  • $after (string)
    Displays after the taxonomies.
    Default: empty string

Default: array()

Code of the_taxonomies: wp-includes/taxonomy.php VER 4.9.8

<?php
function the_taxonomies( $args = array() ) {
	$defaults = array(
		'post' => 0,
		'before' => '',
		'sep' => ' ',
		'after' => '',
	);

	$r = wp_parse_args( $args, $defaults );

	echo $r['before'] . join( $r['sep'], get_the_taxonomies( $r['post'], $r ) ) . $r['after'];
}

Related Functions

From category: For posts

More from Template Tags: Taxonomies (category, tag)

No comments
    Hello, !     Log In . Register