在制作wordpress模板時常會用到的,wordpress調用當前頁面ID代碼。

<?php global $post;
$id = $post -> ID;
echo $id; ?>

在需要的位置上這段代碼,即可顯示出該頁面的ID。