-
-
Save 2ndkauboy/65cdd729e7d815147bbb to your computer and use it in GitHub Desktop.
twentyfifteen-customized
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Theme Name: TwentyFifteen Customized | |
Template: twentyfifteen | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment