I'm currently building a custom theme on top of the _S Underscores Wordpress theme. One of the things I immediately did was remove all the content in the style.css
file, as I want to create my own styling (largely using Bootstrap).
However, I can't seem to get certain attributes in the style.css
to make changes to the html. For example, I'm trying to set the following <h1>
tag to red. But it will not change.
<h1 id="testOfContent">Test</h1>
CSS (in the style.css
file provided by Underscores):
#testOfContent {
color: red;
}
However, the font remains black. How do you manipulate a wordpress theme (especially _S Underscores which is meant to be customizable) to use your own css? Any ideas as to why it won't register my own CSS?
Here's my functions.php
file and how I'm loading the script:
function tlas_css() {
// Enqueue bootstrap css
wp_register_style('bootstrap-css', get_template_directory_uri() . '/bootstrap-3.3.4/css/bootstrap.min.css');
wp_enqueue_style('bootstrap-css');
// Enqueue custom stylesheet
wp_enqueue_style( 'tlas-custom-style', get_template_directory_uri() . '/css/tlas.css' );
wp_enqueue_style( 'tlas-style', get_template_directory_uri() . '/style.css');
}
add_action( 'wp_enqueue_scripts', 'tlas_css' );
h1#testOfContent
instead of#testOfContent
. You need to make sure either - or both - of two things: Make your rule at least as specific as the one you want to override; and if it's not more specific, make sure it's loaded after the other rule. – connexo!important
just to see if anything could get it to work. – carbon_ghost<h1>
tag I posted above is in myheader.php
. I've tried posting this snippet in other files and still to no avail. Clearly something is interfering with my CSS, since I tried this on another site (basic html/css file combo) and it worked fine. – carbon_ghost