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?

  • Did you set any front page in Settings => Reading or you have default wordpress setting to Your latest posts ? – Sumit Apr 25 '15 at 8:57
  • 1
    I solved it know with: $home_id = get_option('page_on_front'); – Torben Apr 25 '15 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/… – Deividas Cha Aug 13 '15 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.