How to get post id of static front page?

I'm trying to use the front page as a default of sorts for featured images (if no featured image is set, I want to use the front page's, for example)

But I'm having trouble finding out how to get the post ID of the front page in a safe manner (so that my code still works when the front page is inevitably changed by someone)

I know I could just hard code an ID in my code, but that'll break when someone decides to use a new content item as the front page.

Would I have to use wp-query to achieve this? And if so, what is a safe way to achieve this with wp-query?

Asked 27 Mar, 17 at 01:11 AM

Tim Martin
Php Wordpress

Answer

Not answersed yet.