WordPressに関する情報や技術紹介です

To get the ID post

Post article to get the ID that is currently displayed.

Can be obtained in "$ post-> ID" In order to get the post ID.
It seems like it is not handed in for some reason (article edit screen) management screen.
I use the following instead.

//投稿IDの取得
global $post_ID;

これで「$post_ID」に投稿IDが入ります。

タグ
トラックバックURL

Leave a Reply

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

ページTOPに戻る