How to get the post id in wordpress

To get the id of a post, add following code:
$id = get_the_ID();
echo $id;

 

In single page just paste the above code. Otherwise include inside the loop.