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
Null. Nothing.
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.
-
int|WP_Post()
$post Post ID or object to get taxonomies of.
Default: current post -
string()
$before Displays before the taxonomies.
Default: empty string -
string()
$sep Separates each taxonomy.
Default: space - string()
$after Displays after the taxonomies.
Default: empty string
Default: array()
-
Changelog
Since 2.5.0 | Introduced. |
Code of the_taxonomies() the taxonomies WP 5.6
function the_taxonomies( $args = array() ) {
$defaults = array(
'post' => 0,
'before' => '',
'sep' => ' ',
'after' => '',
);
$parsed_args = wp_parse_args( $args, $defaults );
echo $parsed_args['before'] . implode( $parsed_args['sep'], get_the_taxonomies( $parsed_args['post'], $parsed_args ) ) . $parsed_args['after'];
}Related Functions
From category: For posts
- get_object_taxonomies()
- get_objects_in_term()
- get_the_category()
- get_the_category_list()
- get_the_tag_list()
- get_the_tags()
- get_the_taxonomies()
- get_the_term_list()
- get_the_terms()