WordPress at a glance
function is not described

the_category_ID() WP 0.71

Deprecated in 0.71. It is no longer supported and can be removed in future releases. Use get_the_category() instead.

Returns or prints a category ID.

  • See: get_the_category()

No Hooks.


Int. Category ID.


the_category_ID( $echo );
Whether to echo the output.
Default: true

Code of the category ID: wp-includes/deprecated.php WP 5.2.2

function the_category_ID($echo = 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 ( $echo )
		echo $cat;

	return $cat;