WordPress获取当前文章ID标签:the_ID

WordPress模板标签the_ID用于输出当前文章的ID,需要用在The Loop主循环里。

the_ID()

使用示例:

<p>文章ID: <?php the_ID(); ?></p>

扩展阅读

the_ID()函数位于:wp-includes/post-template.php

相关函数:

阿里云