Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy
Last active May 14, 2016 22:09
Show Gist options
  • Save 2ndkauboy/65cdd729e7d815147bbb to your computer and use it in GitHub Desktop.
Save 2ndkauboy/65cdd729e7d815147bbb to your computer and use it in GitHub Desktop.
twentyfifteen-customized
<?php
function twentyfifteen_parent_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'twentyfifteen_parent_enqueue_styles' );
/**
* @param $wp_customize WP_Customize_Manager
*/
function twentyfifteen_customized_setting_custom_css( $wp_customize ) {
$wp_customize->add_setting( 'custom_theme_css', array(
'type' => 'theme_mod',
) );
$wp_customize->add_control( 'custom_theme_css', array(
'label' => __( 'Custom Theme CSS', 'twentyfifteen-customized' ),
'type' => 'textarea',
'section' => 'custom_css',
) );
$wp_customize->add_section( 'custom_css', array(
'title' => __( 'Custom CSS', 'twentyfifteen-customized' ),
'description' => __( 'Add custom CSS here', 'twentyfifteen-customized' ),
'priority' => 160,
'capability' => 'edit_theme_options',
) );
}
add_action( 'customize_register', 'twentyfifteen_customized_setting_custom_css' );
function twentyfifteen_customized_custom_css_output() {
echo '<style type="text/css" id="custom-theme-css">' .
get_theme_mod( 'custom_theme_css', '' ) .
'</style>';
}
add_action( 'wp_head', 'twentyfifteen_customized_custom_css_output');
/**
Theme Name: TwentyFifteen Customized
Template: twentyfifteen
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment