Skip to content

Instantly share code, notes, and snippets.

@florianbrinkmann
Last active May 14, 2017 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florianbrinkmann/4356ffbb8badf9604cdfbb88f09ef2df to your computer and use it in GitHub Desktop.
Save florianbrinkmann/4356ffbb8badf9604cdfbb88f09ef2df to your computer and use it in GitHub Desktop.
<?php
/**
* Create starter content for new sites.
*/
add_theme_support( 'starter-content', [
/**
* Add attachments that are used by posts and pages.
*/
'attachments' => [
'featured-image-about-page' => [
'post_title' => 'Featured image for about page',
'file' => 'assets/images/starter-content/featured-image-about-page.jpg',
],
],
/**
* Create and modify posts and pages.
*/
'posts' => [
'home' => [
'post_content' => __( 'Welcome to your site! This is your homepage, which is what most visitors will see when they come to your site for the first time.
The »Photographus« theme lets you use different areas for the front page, so-called »panels«. With that, you can display different content types on the front page: You can choose from a grid of your latest gallery and image posts, a list of your latest posts or a single page/post.
To edit the panels you see here, just click on the pen icon on the left.', 'photographus' ),
],
'about' => [
'template' => 'templates/large-portrait-featured-image.php',
'thumbnail' => '{{featured-image-about-page}}',
'post_content' => __( 'Just introduce yourself! This page uses the template with a large portrait featured image. If you do not use a sidebar, the image is displayed next to the content on large viewports.', 'photographus' ),
],
'blog',
'snowy-landscape' => [
'post_type' => 'post',
'post_name' => 'snowy-landscape',
'post_title' => 'Snowy Landscape',
],
],
/**
* Remove default core starter content widgets
*/
'widgets' => [
'sidebar-1' => [
'search',
'text_about',
],
],
/**
* Set options
*/
'options' => [
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}',
'header_image' => get_theme_file_uri( 'assets/images/starter-content/featured-image-about-page.jpg' ),
],
/**
* Fill nav menus
*/
'nav_menus' => [
'primary' => [
'name' => __( 'Primary Menu', 'photographus' ),
'items' => [
'page_home',
'page_about',
'page_blog',
],
],
],
/**
* Set values for theme mods
*/
'theme_mods' => [
/**
* Set the values for the first front page panel.
*/
'photographus_panel_1_content_type' => 'latest-posts',
'photographus_panel_1_latest_posts_short_version' => true,
/**
* Set the values for the second front page panel.
*/
'photographus_panel_2_content_type' => 'post',
'photographus_panel_2_post' => '{{snowy-landscape}}',
],
] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment