Child theme css. Recommendation and problem.
-
Custom css works when in, Customizer/Additional CSS; but once i delete from here and save to style.css in child theme, the customization disappears. Meaning not pulling the css from the file!
1) The most recommend way in general, and also most secure, to avoid loosing customization on upgrade, is to have the custom css in style.css in the child theme, right?
I don’t know much about php yet although i followed the child theme codex:
https://codex.www.ads-software.com/Child_ThemesHere’s my functions.php code in case you can help.
<?php function my_theme_enqueue_styles() { $parent_style = 'onetone-style'; // This is 'Onetone-style' for the Onetone_Child theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Child theme css. Recommendation and problem.’ is closed to new replies.