1 |
<?php the_ID(); ?> |
1 |
<section id="post-<?php the_ID(); ?>">...</section> |
WordPressループの中で投稿のIDを文字列として取得する
1 |
<?php $post_id = get_the_ID(); ?> |
1 2 3 4 |
<?php global $post; $post_id = $post->ID; ?> |