0

I have a child theme that is not showing my CSS changes at all. When I inspect element, the changes don't show in the explorer window. I look in the head and the child theme style is not enqueuing.

Child functions.php:

<?php

add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style');
function enqueue_parent_theme_style() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}

Child style.css:

/*
Theme Name: Jevelin Child
Description: Child theme for Jevelin theme
Author: Shufflehound
Author URI: http://shufflehound.com
Template: jevelin
Text Domain: jevelin-child
*/

/* Add your custom CSS below */

I have no idea what the culprit could be.

2

Please use this instead of what you are using. This will definitely work.

 <?php
       function my_theme_enqueue_styles() {

    $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>

For more details on configuring Child themes in WordPress please refer to this link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.