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.– gdanielCommented Sep 29, 2015 at 17:56
-
Thanks, I searched for a solid hour and never came across this!– HeatherCommented Sep 30, 2015 at 2:13
Add a comment
|
1 Answer
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 );