A maintenance event to our servers or software is in progress. It may not affect you. Select the link on the right for details. Learn more

My child theme style.css doesn't work Print

  • 1

When this happens it's normally because the parent theme doesn't actualy use style.css for styling. This means that we'll need to dynamically enqueue the stylesheet via functions.php. Like this:

<?php

add_action('wp_print_styles', 'websavers_add_stylesheet', 20);

function websavers_add_stylesheet() {
$websavers_style = get_stylesheet_uri();
wp_register_style('websavers_style', $websavers_style);
wp_enqueue_style('websavers_style');

}

?>


Was this answer helpful?

← Back