Changing Color of Header Text using CSS in Child Theme
-
Topic
-
I watched the videos about Child Themes and about using Firebug to identify and change things (which are great!), and I read the tutorial in the developer docs about adding your own CSS file between framework styles and style.css.
I wanted to change the color of the header text, and I have done it in Theme Options/Styles/Custom CSS, but I would rather do it in the Child theme and learn to write my own CSS.
According to Firebug (and by looking at it in the files) it’s defined in alyeska/assets/css/theme.css and theme.min.css. So merely putting the change from
#branding .header-text { color: #FFFFFF; to #branding .header-text { color: #FF0000;
in the Child style.css file will not make it work because in the Parent theme the theme.css gets called before style.css. And we definitely do not want to edit the original Parent theme file.
Reading the article about adding your own CSS, there’s a lot in there that is too advanced for me, so here are my dummy questions.
When you say “you need a CSS file intricately placed in between the framework styles and your style.css file”, is this file written and placed physically in the Child Theme folder under assets/css along with custom.css?
(Method One)
1. Where is this global variable located?
2. Am I supposed to put this into functions.php in the Child theme?:
function my_stylesheets() { global $themeblvd_framework_styles; wp_enqueue_style( 'my-stylesheet', get_stylesheet_directory_uri() . '/myfile.css', $themeblvd_framework_styles ); } add_action( 'wp_enqueue_scripts', 'my_stylesheets' );
3. Do I create a separate CSS file in the Child Theme, say, in alyeska-child/assets, along with the existing custom.css?
(Method Two)
1. Would I add the function of my_stylesheets to the functions.php file in the Child theme? Is my_stylesheets an example and I would have to name mine something different?2. How much of this is something I have to write? (like ‘/myfile.css would not be exactly that, but something I would write myself; would ‘my-stylesheet’ also be something I have to define?) If so, where would they belong?
function my_stylesheets() { global $themeblvd_framework_styles; wp_enqueue_style( 'my-stylesheet', get_stylesheet_directory_uri() . '/myfile.css', $themeblvd_framework_styles ); } add_action( 'wp_enqueue_scripts', 'my_stylesheets' );
Again, apologies for not knowing a lot of this stuff, but I really would like to learn how to edit this myself instead of just using Custom CSS on the Theme Options/Style page.
Thanks!
- The forum ‘Alyeska Responsive WordPress Theme’ is closed to new topics and replies.