some things in child theme css not overriding parent

You have to set a new background or the one defined in the parent stylesheet will be applied. background-image: none; Image and color are not mutually exclusive, so both just deleting the background-image line or/and defining a background-color won’t change a background image defined somewhere else.

WordPress CSS head info – contents, expansions?

There is no reason to add something not listed in WP_Theme class $file_headers array because it simply will not be recognized. private static $file_headers = array( ‘Name’ => ‘Theme Name’, ‘ThemeURI’ => ‘Theme URI’, ‘Description’ => ‘Description’, ‘Author’ => ‘Author’, ‘AuthorURI’ => ‘Author URI’, ‘Version’ => ‘Version’, ‘Template’ => ‘Template’, ‘Status’ => ‘Status’, ‘Tags’ => … Read more

Disable child theme css on certain pages

There are two methods to accomplish what you what need to do. METHOD 1 The first method is to create a separate stylesheet from your child’s main style.css, and then move all your css into that stylesheets. For this example, lets call this stylesheet custom-style.css. As said, copy all the css that will be specific … Read more

To enqueue or not to enqueue

Method 2 You can enqueue all of your stylesheets form the same place even controlling where the stylesheets load by means of template conditionals, which is convenient and prevents a lot of mess in your <head>. You can remove enqueued stylesheets if you need to via a plugin, for example. Enqueued stylesheets are child theme … Read more

Custom colors for post rows based on post meta value

If your theme uses wp post class function post_classes($classes) { global $post; $customMetaVariable = get_post_meta( $post->ID, ‘customMetaName’, true ); if($customMetaVariable == ‘desiredCustomMetaValue’){ $classes[] = ‘cssClassName’; return $classes; } } add_filter(‘post_class’, ‘post_classes’); then in your style.css you could use: .cssClassName{ background-color: red; } hence applying that class to all of the posts that contain your desired … Read more

How can I make new .css file in child theme override styles in child theme’s style.css

You can enqueue your own stylesheet by adding this to your child theme’s functions.php file: function wpa_custom_css(){ wp_enqueue_style( ‘wpa_custom’, get_stylesheet_directory_uri() . ‘/responsive.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpa_custom_css’, 999 ); This will load the file responsive.css located in your child theme directory. The priority is set very low (999) so it is more likely to appear … Read more

functions.php not adding css to website?

I don’t know if you try to add a css file in your theme or plugin. I will provide both examples. Use wp_enqueue_style in combination with get_theme_file_uri to enqueu a stylesheet in your theme directory. For a theme, see example function add_styles() { wp_enqueue_style( ‘fontawesome-style’, get_theme_file_uri( ‘/assets/css/all.css’ ), array(), null ); } add_action( ‘wp_enqueue_scripts’, ‘add_styles’ … Read more