Skip to content

Instantly share code, notes, and snippets.

@2ndkauboy

2ndkauboy/functions.php Secret

Last active May 14, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.