WordPress函数the_ID()显示当前文章ID

描述:

显示当前文章ID,其实就是

<?php echo get_the_ID();?>

用法:

 <?php the_ID(); ?> 

参数:

此函数不接受任何参数

示例:

<p>Post Number: <?php the_ID(); ?></p>

源文件:

/**
 * Display the ID of the current item in the WordPress Loop.
 *
 * @since 0.71
 */
function the_ID() {
	echo get_the_ID();
}