Home › Forums › Pro Themes › Onefold Pro › Overiding CSS in a child theme
Tagged: child themes, css, customization
- This topic has 2 replies, 2 voices, and was last updated 6 years, 1 month ago by wensolutions.
-
AuthorPosts
-
December 15, 2017 at 3:52 pm #60965dickkirklandParticipant
Hello!
I notice that when trying to change such things as…
/* slider headers and captions */
#main-slider p, #main-slider h3 {
background-color: rgba(0,0,0,.37);
}I can only seem to override styles in the “Additional CSS” section within the theme vs. WordPress’ editor which is writing to a child-theme .css file that I have enqued within funtions.php.
Is there any reason why the “Additional CSS” area within the theme’s customization area is taking precedence over my custom CSS file which is set up in a child theme?
This functionality would be helpful on several fronts when using my child theme.
Any advice would be greatly appreciated.From my functions.php…
<?php
function my_theme_enqueue_styles() {$parent_style = ‘onefold-pro’; // This is ‘onefold-pro’ parent.
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’ );
?>December 15, 2017 at 4:21 pm #60966dickkirklandParticipantOverriding CSS seems to work in my enqued .css now.
This is only when I select “default” in the associated color palette?#main-slider p, #main-slider h3 {
background-color: rgba(0,0,0,.33);
}
now works in another area.Is this normal behavior?
For anything that I want to overwrite, do I keep the theme defaults in place?
Is there a conditional that delivers this behavior?Really sorry for all of the questions.
Your advice and help is always appreciated.Sincerely,
DickDecember 16, 2017 at 10:59 am #61007wensolutionsKeymasterHello @dickkirkland,
The CSS that is included in the Additional CSS of the customizer will load at first and this how theme works.
So if you have to overwrite any CSS within the theme then you can post the CSS in Additional CSS as it load at first.
You can also use child theme for any style modification in the theme if you have to make lots of modification but if you have to modify just one, 2 section then you can use additional CSS.
Hope this helps.
Best Regards!!
-
AuthorPosts
- You must be logged in to reply to this topic.