0

I'm experiencing an issue with my WordPress child theme. I created a child theme based on the 'drinkify-lite' parent theme and used the provided code to enqueue the parent styles in my child theme's functions.php. However, when I activate the child theme, it seems to revert to the original parent theme, and the customizations I made on the parent theme are no longer visible.

I've double-checked the code, and it appears to be correctly enqueuing the parent styles. Is there something I might be missing or a common mistake that causes this behavior? Any guidance on how to ensure that my child theme retains the customizations would be greatly appreciated. Thank you!

1
  • Perhaps you could share the code?
    – vancoder
    Commented Oct 23, 2023 at 18:44

1 Answer 1

0

This problem may have several underlying causes. I encourage you to create your child theme from scratch and make sure working fine without any deep customization.

Practically speaking, the child theme works fine with the style.css and the functions.php file only.

/*
Theme Name:   Drinkify Lite Child
Template:     drinkify-lite
Version:      1.0.0
*/

body {
    background: green;
}

Create the functions.php file in the child directory (drinkify-lite-child) something similar:

<?php

function drinkify_light_child_enqueue_styles() {

    $parent_style = 'drinkify-lite-style';

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'drinkify_light-child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style )
    );
}
add_action( 'wp_enqueue_scripts', 'drinkify_light_child_enqueue_styles' );

/* --------- Insert your customized functions on the next rows --------- */

And then add your customization functions one by one and see which one causing the problem.

Read more about the child theme here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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