1

my start page in WP shows the latest posts.

I added some meta fields to the start page in the WP backend which I want to access before the list of recent posts starts. I try to access the meta values via "get_the_ID", but this function always returns the ID of the first post, even when I use the hook before the loop.

How can I retrieve the ID of the page which is set up as start page?

3
  • Did you set any front page in Settings => Reading or you have default wordpress setting to Your latest posts ?
    – Sumit
    Commented Apr 25, 2015 at 8:57
  • 1
    I solved it know with: $home_id = get_option('page_on_front');
    – Torben
    Commented Apr 25, 2015 at 9:20
  • 1
    <?php $page_for_posts = get_option( 'page_for_posts' ); //output results: echo $page_for_posts; ?> Works for me in 4.2 wp version. Ref: wordpress.stackexchange.com/questions/32620/… Commented Aug 13, 2015 at 21:55

0

Browse other questions tagged or ask your own question.