wordpress get post id
// Retrieve the ID of the current item in the WordPress Loop. get_the_ID()
Here is what the above code is Doing:
1. We’re using the get_the_ID() function to retrieve the ID of the current item in the WordPress Loop.
2. We’re using the get_post_meta() function to retrieve the value of the _custom_meta_key custom field.
3. We’re using the esc_html() function to escape the value of the custom field.
4. We’re using the echo() function to output the value of the custom field.