Last active
February 16, 2017 20:20
-
-
Save westonruter/a5ce4e3848bc0a22f24587ec41081709 to your computer and use it in GitHub Desktop.
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 my_styles_method() { | |
wp_enqueue_style( 'custom-style', get_template_directory_uri() . '/custom-css.css' ); | |
$colors = array( | |
'headings_color' => get_theme_mod( 'wpt_heading_color' ), | |
); | |
$css_output = "{color: {$colors['headings_color']}; }"; | |
$selector = 'h1,h2,h3,h4,h5,h6'; | |
$css = $selector . $css_output; // @todo The $css variable is not used. | |
if ( is_customize_preview() ) { | |
wp_enqueue_script( 'wpt_customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '', true ); | |
wp_add_inline_script( 'wpt_customizer', sprintf( 'var MyStylesSelector = %s;', wp_json_encode( $selector ) ), 'before' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'my_styles_method', 21 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment