Skip to content

Commit

Permalink
Use wp_style_add_data to define minified file
Browse files Browse the repository at this point in the history
  • Loading branch information
grappler committed Jan 7, 2017
1 parent 1b92b30 commit c972ef8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions.php
Expand Up @@ -124,11 +124,12 @@ function penguin_scripts() {
$theme = wp_get_theme();
$penguin = wp_get_theme( 'penguin-gold' );
$minified = get_theme_mod( 'min-files' );
$suffix = ( 1 == $minified ) ? '.min' : '';
$suffix = ( 1 === $minified ) ? '.min' : '';
$fluidvids = get_theme_mod( 'fluidvids', true );

if ( is_child_theme() ) {
wp_enqueue_style( 'penguin-parent-style', get_template_directory_uri() . '/style' . $suffix . '.css', false, $penguin['Version'] );
wp_enqueue_style( 'penguin-parent-style', get_template_directory_uri() . '/style.css', false, $penguin['Version'] );
wp_style_add_data( 'penguin-parent-style', 'suffix', $suffix );
}

wp_enqueue_style( 'penguin-style', get_stylesheet_uri(), false, $theme['Version'] );
Expand Down

0 comments on commit c972ef8

Please sign in to comment.