0

I am trying to pull in <?php the_content(); ?> for the page I have defined as the static front page in WordPress's back-end but can't figure out how to target it and pull it in.

  • If you want to define a template for the static frontpage you selected under settings. You can create a file called front-page.php. If you just need the_content(), you can follow @Sisir instructions below. – gdaniel Sep 29 '15 at 17:56
  • Thanks, I searched for a solid hour and never came across this! – Heather Sep 30 '15 at 2:13
1

The id of the static front page saved as an option name page_on_front. You can get it as

$front_page_id = get_option('page_on_front');

Once you have it call get_post_field().

$content = get_post_field('post_content', $front_page_id );

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.