Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'wp_enqueue_scripts', 'enigma_child_enqueue_styles' );
- function enigma_child_enqueue_styles() {
- wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
- }
- 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 );
- } );
- }
- ?>
Add Comment
Please, Sign In to add comment