the_category_ID()
Deprecated from version 0.7. It is no longer supported and can be removed in future releases. Use get_the_category() instead.
Returns or prints a category ID.
No Hooks.
Return
Int
. Category ID.
Usage
the_category_ID( $display );
- $display(true|false)
- Whether to display the output.
Default: true
Notes
- See: get_the_category()
Changelog
Since 0.71 | Introduced. |
Deprecated since 0.71 | Use get_the_category() |
the_category_ID() the category ID code WP 6.7.1
function the_category_ID($display = true) { _deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' ); // Grab the first cat in the list. $categories = get_the_category(); $cat = $categories[0]->term_id; if ( $display ) echo $cat; return $cat; }