Returns de current post id outside the loop.
<?php // Returns de current post id outside the loop. global $post; echo $post->ID; ?>