I’m building a WordPress plugin in which I need to get the HOME page ID value.
Do you know how can I get it?
I know that we can get the current ID with
get_the_ID() function, but I need specificly the HOME page ID value.
My plugin is located at the following directory path:
$pageID = get_option('page_on_front'); should get you the Page ID of the page set at ‘Front Page’ in WordPress options.
If by Home Page you mean the page designated as the Posts page, the ID is stored in the option
page_for_posts. If the value is 0, there is no designated home page.