Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Can you link your site with the Child Theme active?
Thank you for your reply. Unfortunately I can’t give you a link to the site because the site is only accessible internally… :-s
I have made a new folder –> ascent-child
I’ve put a style.css in it with following header:
@import url("../ascent/style.css");
/* ------------------------------------------------------
Theme Name: XXXX
Theme URI:
Description: Child theme for the ascent theme
Author: Nina
Author URI:
Template: ascent
Version: 0.1.0
-----------------------------------------------------------*/
The theme works. I can see my site without any problems. I just can’t change anything about the look of the site. When I put something in a the css, nothing happens. It keeps refering to the css of the parent theme.
Also, now I have switched back to the parent theme and I want to change something in the css file using the build in editor in WordPress nothing changes.
It can’t be that I have to edit the main.css of the parent theme?
Can anyone please help me?
Hi Nientje07,
You can add the below code inside your child theme’s functions.php
function ascent_high_priority_style() {
if (is_child_theme()) {
wp_enqueue_style('child-custom-css', get_stylesheet_directory_uri() . '/child-custom.css', array(), '1.0.9', 'all');
}
}
add_action( 'wp_enqueue_scripts', 'ascent_high_priority_style', '999' );
Then create a CSS file name ‘child-custom.css’ inside your child theme. Inside this ‘child-custom.css’ file you can add your custom style.
That worked!! thanks a lot!! π