the_ID() - WordPress 函数参考中文文档

返回介绍

the_ID()

发布于 2017-09-11 字数1644 浏览 923 评论 0

the_ID()

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


描述


源代码

File: wp-includes/post-template.php

function the_ID() {
	echo get_the_ID();
}

更新日志

Version 描述
0.71 Introduced.

相关函数

Uses

  • wp-includes/post-template.php:
    get_the_ID()

Used By

  • wp-admin/includes/class-wp-posts-list-table.php:
    WP_Posts_List_Table::column_cb()
  • wp-includes/widgets/class-wp-widget-recent-posts.php:
    WP_Widget_Recent_Posts::widget()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 1You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Default usage.

    
    <p>Post Number: <?php the_ID(); ?></p>
    
  2. This example shows how to provide a unique anchor identifier to each post.

    
    <h3 id="post-<?php the_ID(); ?>"><?php the_title(); ?></h3>
    

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!