Child Theme is ignored
-
I want to change the color of the bar below the ‘Poste On’ line from green to red. I have created a child theme and edited the color in the child theme but when I inspect the site it still loads this part from the parent theme.
What I do:
1) Load Child Theme last in function.php
function test_dequeue_styles() { // this removes the original style wp_dequeue_style( 'start-style' ); wp_deregister_style( 'start-style' ); } add_action( 'wp_enqueue_scripts', 'test_dequeue_styles', 20 ); function test_enqueue_styles() { // parent style ( this loads the css from the main folder ) wp_enqueue_style( 'start-parent-style', get_template_directory_uri() .'/style.css' ); } add_action( 'wp_enqueue_scripts', 'test_enqueue_styles' ); function new_enqueue_styles() { // child style ( this loads the css from the child folder after parent-style ) wp_enqueue_style( 'start-child-style', get_stylesheet_directory_uri() .'/style.css' ); } add_action( 'wp_enqueue_scripts', 'new_enqueue_styles', 999 );
2) Modify the color in styles.css (in Child theme)
.total-comments span:after, span.sticky-post, .nav-previous a:hover, .nav-next a:hover, #commentform input#submit, #pageasyform input[type='submit'], .home_menu_item, .currenttext, .pagination a:hover, .readMore a, .bclwp-subscribe input[type='submit'], .pagination .current, .woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current, .woocommerce-product-pageasy input[type="submit"], .woocommerce a.button, .woocommerce-page a.button, .woocommerce button.button, .woocommerce-page button.button, .woocommerce input.button, .woocommerce-page input.button, .woocommerce #respond input#submit, .woocommerce-page #respond input#submit, .woocommerce #content input.button, .woocommerce-page #content input.button, #sidebars h3.widget-title:after, .postauthor h4:after, .related-posts h3:after, .archive .postsby span:after, .comment-respond h4:after, .single_post header:after, #cancel-comment-reply-link, .upper-widgets-grid h3:after, .site-branding .site-title:after, .thumbnail-post-content .entry-meta:after {background-color: #d7000a; }
I don’t understand why the child theme is not taken into account for this.
On a similar note is there a way to exactly identify the name/element with Chrome –> inspect (i.e. the line after the posted on) as the above only shows a very long list of elements the color is applied on.
Appreciate any help.
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Child Theme is ignored’ is closed to new replies.