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.

2
  • 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
    Commented Sep 29, 2015 at 17:56
  • Thanks, I searched for a solid hour and never came across this!
    – Heather
    Commented Sep 30, 2015 at 2:13

1 Answer 1

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 and acknowledge you have read our privacy policy.

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