Create a child theme

Hi everyone! I try to create a child theme following steps described on wordpress.org, but having trouble enqueueing the parent and child theme stylesheets. I’m doing it by adding a wp_enqueue_scripts action and using wp_enqueue_style()in my child theme’s functions.php and it seems not to work.

Here is my functions.php:

<?php
function my_theme_enqueue_styles() {

    $parent_style = 'blaskan-style';  

    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' );
?>

Could you please help me and tell what I’m doing wrong, thanks in advance.

hi there

Please use this plugin to create temporary access for us, its automatic login link and does not requires sharing your admin details. here is How To guide. at the and don’t forget about  “Set as private reply” at the bottom of the message box  

Can it be applied to any theme? I am curious to try it now. Thank you for this simple tutorial, Noda. I need someone to write my assignment

hi there

@jeannestacey - advertisement is not allowed here :wink:

Good evening. Does the child theme have to stay active throughout the life of the site, and when we want to make changes, it is only and only in this one? And how to do exactly when you have an update of its theme? there is need to update the child theme or it does it automatically once the basic theme is updated?


https://getappvalley.com/
https://tutuapp.win/
https://tweakbox.mobi/

Hi there,
Thanks for writing back.
To answer your question here, an update only affects the parent theme. You shouldn’t update your child theme. I would recommend on having any theme file customization within the child theme to avoid overwriting of the customized files within the parent theme upon a theme update. Please check on this article (https://codex.wordpress.org/Child_Themes) for more information on child themes.

I hope this helps.
Best Regards,
Support.

We need to be careful while creating child theme and then editing it. Take all precautions before editing your theme.

Hi Hasanden,
Thanks for writing in.
Relating to your statement here, yes that is true.
Please let us know if you have any questions.
Best Regards,
Support.