CSS styles of my child theme don’t work
-
Hi guys, I have installed my child theme on the base of astra.
I have main 2 files: style.css and fuctions.php
(also I have a JS file to make a button to close messages from woocommerce and it works)
But for some reason whatever I write in style.css, it doesn’t work.
I have tested that css code in additional code in astra theme and in elementor css and it works, but in my style.css it doesn’t.CSS code in style.css:
/*
Theme Name: Astra Child
Template: astra
Version: 1.0
*/
.wc-message-close {
background-color: #3CB371;
color: #3CB371;
border: none;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
font-size: 14px;
line-height: 1;
}in my PHP file I have:
<?php
function astra_child_enqueue_styles() {
wp_enqueue_style('astra-parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('astra-child-style', get_stylesheet_directory_uri() . '/style.css', array('astra-parent-style'));
}
add_action('wp_enqueue_scripts', 'astra_child_enqueue_styles');also I tried
/ enqueue styles for child theme
function example_enqueue_styles() {
// enqueue parent styles
wp_enqueue_style('parent-theme', get_template_directory_uri() .'/style.css');
// enqueue child styles
wp_enqueue_style('child-theme', get_stylesheet_directory_uri() .'/style.css', array('parent-theme'));
}
add_action('wp_enqueue_scripts', 'example_enqueue_styles');also I tried
<?php
function astra_child_enqueue_styles() {
wp_enqueue_style('astra-parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('astra-child-style', get_stylesheet_directory_uri() . '/style.css', array('astra-parent-style'), '1.0');
}
add_action('wp_enqueue_scripts', 'astra_child_enqueue_styles');Via inspect, I don’t see my css code it’s not even crossed out, it’s simply not there.
P.S. it’s my first website and i’m just starting with codding and stuff. I read a lot of forums with this topic, but cannot resolve my issue.
Please, assist)
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.