[wp-hackers] Post Id Question

David House dmhouse at gmail.com
Mon Apr 4 15:17:11 GMT 2005


On Apr 4, 2005 4:14 PM, Ryan Duff <ryan at ryanduff.net> wrote:
> $post_id = the_ID();

This won't work. the_ID() is an echoing template tag, meaning that
it'll echo the ID rather than return it. What you want is Kimmo's
answer, using the global $id variable, or alternatively $post->ID
should be available as well.

-- 
-David House, dmhouse at gmail.com


More information about the wp-hackers mailing list