echo post id wordpress code example Example: wordpress get post id // Retrieve the ID of the current item in the WordPress Loop. get_the_ID()