I have twentyseventeen child-theme, and I found this code:
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles',99);
function child_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'seventeen-child',get_stylesheet_directory_uri() . '/style.css', array( $parent_style ));
}
if ( get_stylesheet() !== get_template() ) {
add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {
update_option( 'theme_mods_' . get_template(), $value );
return $old_value; // prevent update to child theme mods
}, 10, 2 );
add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
return get_option( 'theme_mods_' . get_template(), $default );
} );
}
..
But there is problem that style.css is loading twice. I tried code from Reference Wordpress, but then my overrides files like footer.php, navigation.php from child-theme are not loading.
Could someone help me with it to avoid loading .css twice and keep full functionality?