Child theme

Hello,

I wanted to begin to style the theme so I created a child theme.

As I don’t know the good way to create a child theme, i used the plugin Child Theme Configurator to do it. I tried with another plugin but the theme was looking totally broken (at least, the Child Theme Configurator gave me a child theme that looked like the parent).

Here is the functions code it gaves me:

<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );

if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
    function chld_thm_cfg_parent_css() {
        wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'bootstrap','font-awesome','flexslider' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );

// END ENQUEUE PARENT ACTION

BUT !

I have a problem now. When I modify the css of my child theme (in the css file of my child theme), nothing happens. I just noticed now that if I do the same modification in the css of the parent theme, the modification works well.

So, is my functions of the child theme good ? Because I can’t understand why the small css change in my child theme doesn’t work but works perfectly in the css of the parent theme.

Can you help please ?

Good evening

When you use child theme new styles must be added in the child theme style.css file, so this means you are doing things correctly, can you tell me which css code is not working? have you tried to add your code with an important tag? also please include link to your page

I would like but I am working offline (with Xampp).

I tried easy things like changing colors. With !important it works. But I would need to add !important everywhere why ?

Also I try to modify the footer copyright with a “Proudly made by and with”. The modification in the extra (inc) doesn’t work at all in the child theme. BUT it works perfectly fine in the parent Shapely folder.

Why can’t it work fine in the child folder ? Maybe it comes from the functions code (see before) ? I lose a lot of time making styling that doesn’t show in the child theme…

Good morning

“But I would need to add !important everywhere why ?” - im sure not all style rules require important but if needed then yes :slight_smile:
footer - i don’t know how you modify it can you show me?
p.s for this modification make sure you have a license:
https://colorlib.com/wp/licence/
@mbaker from my experience I know a lot of our customers are using a child theme and they don’t have such problems,