wordpress snippets last updated   : April 14, 2014
we now have 630 snippets

Get post ID outside of loop

wordpress snippet

Adding this PHP code snippet to your single.php will return the current post ID.

snippet :  PHPcopy
<?
       global $wp_query;
       $postID = $wp_query->post->ID;
?>

jqsnipp.com | we just launched jquery snippets website