Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get the id inside the loop with a WP function
- ---------------------------------------------
- the_id();
- Get the id inside the loop
- --------------------------
- <?php global $post;
- $postid = $post->ID;
- ?>
- Get the id outside of the loop
- ------------------------------
- <?php global $wp_query;
- $postid = $wp_query->post->ID;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement