Title: Dynamically reference home ID
Last modified: August 19, 2016

---

# Dynamically reference home ID

 *  [christhesoul](https://wordpress.org/support/users/christhesoul/)
 * (@christhesoul)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/dynamically-reference-home-id/)
 * Is it possible to dynamically reference the ID of the page that is set to home?
 * So instead of of $post->ID or hard-coding the, for instance, ’27’, can you reference
   homepage->ID or something similar?
 * Cheers

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/dynamically-reference-home-id/#post-1530092)
 *     ```
       echo 'page on front is id '. get_option('page_on_front');
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Dynamically reference home ID’ is closed to new replies.

## Tags

 * [home](https://wordpress.org/support/topic-tag/home/)
 * [id](https://wordpress.org/support/topic-tag/id/)

 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/dynamically-reference-home-id/#post-1530092)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
