The reference to a post needs the item symbol within double curly braces:
add_action('after_setup_theme', function () {
add_theme_support( 'starter-content', array(
'posts' => array(
'home' => array(
// Use a page template with the predefined about page
'template' => 'template-frontpage.php',
),
),
'options' => array(
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
),
));
});
And remember: currently, starter-content works only on “fresh sites”, that is new installs that have not yet had any posts, pages, widgets, or customizer settings updated. This state is indicated in the fresh_site
option with a value of 1
; if this option is 0
, you can set it back to 1
and starter-content will work in a non-fresh site as well. It is planned to allow starter content for non-fresh site in future release (thanks @weston-ruter).