Skip to content

Instantly share code, notes, and snippets.

@craigiswayne
Created June 6, 2017 17:06
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 craigiswayne/2312b56d76f2e5c0dfc5764160ddd0cc to your computer and use it in GitHub Desktop.
Save craigiswayne/2312b56d76f2e5c0dfc5764160ddd0cc to your computer and use it in GitHub Desktop.
WordPress Starter Content and Theme Support
<?php
/**
* @see https://roots.io/using-and-customizing-wordpress-starter-content/
*/
add_action( 'after_setup_theme', function () {
add_theme_support( 'starter-content', [
'options' => [
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'blogname' => 'Rodale Inc',
'blogdescription' => 'We inspire health, healing, happiness, and love in the world. Starting with you.'
],
'posts' => array(
// Post Symbol -> for internal use
'home' => array(
'post_type' => 'page',
'post_title' => _x( 'Home', 'Theme starter content' ),
'post_content' => _x( '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.', 'Theme starter content' ),
),
)
] );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'custom-logo', [
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => [ 'site-title', 'site-description' ],
] );
add_theme_support( 'custom-header', [
'width' => 980,
'height' => 320,
'flex-height' => true,
'flex-width' => true,
'video' => true,
'default-image' => get_stylesheet_directory_uri() . '/assets/images/default-header.png'
] );
add_theme_support( 'custom-background', [
'width' => 1400,
'height' => 900,
'default-repeat' => 'no-repeat',
'default-position-x' => 'center',
'default-attachment' => 'fixed'
] );
add_theme_support( 'custom-video' );
add_theme_support( 'post-formats' );
add_theme_support( 'html5', [
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption'
] );
add_theme_support( 'menus' );
add_theme_support( 'content_width' );
add_theme_support( 'editor-style' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'sidebar' );
add_theme_support( 'widgets' );
add_theme_support( 'customize-selective-refresh-widgets' );
add_theme_support( 'widget-customizer' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment