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 the_ID() or get_the_ID() function, but I need specificly the HOME page ID value.

My plugin is located at the following directory path:

wp-content/plugins/myPlugin/

2 s
2

$pageID = get_option('page_on_front'); should get you the Page ID of the page set at ‘Front Page’ in WordPress options.

Leave a Reply

Your email address will not be published. Required fields are marked *