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

作者: 站长 上传时间: 浏览: N/A 下载: N/A 格式: N/A 评分: N/A

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

the_ID()

使用示例:

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

扩展阅读

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

相关函数:

  • get_the_ID()
  • the_title()
  • the_title_attribute()