W3cubDocs

/WordPress

the_ID()

Display the ID of the current item in the WordPress Loop.

Source

File: wp-includes/post-template.php

function the_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	echo get_the_ID();
}

Changelog

Version Description
0.71 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/the_id