• Hi,

    My parent theme name is Grow and I’ve created a child theme named Grow Child.

    I’ve executed the steps specified in Child themes guidance.
    Now I have my Child theme activated.

    The problem is that when I edit the files from the parent and save them in my child folder they don’t overwrite the originals.
    I guess, I didn’t customize my functions.php file properly.

    Can somebody help in customization? I use this code which is given in the guidance:

    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    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')
        );
    }
    ?>

    Please, tell me where to write what?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, Might be easier using a child creation plugin and deleting the plugin after creating the child theme. Some plugins allow you to select as many files to create as you want. Depending on the level of customization you require. Good luck

    It’s not necessarily possible to replace any arbitrary file with a child theme. This is a common misconception.

    WordPress will automatically check the child theme for files in the Template Hierarchy, plus a couple of additional files, including searchform.php, comments.php, header.php, and footer.php, sidebar.php and 404.php.

    Its not possible to replace any other theme files unless the parent theme supports it. Parent themes need to use certain functions to load files for them to be replaceable by child themes. If they don’t, then they’re not replaceable.

    If there’s something specific you want to change in your child theme, but aren’t sure if you can, check with the theme author.

    • This reply was modified 6 years, 11 months ago by Jacob Peattie.
    Thread Starter mrblond

    (@mrblond)

    For now, I just want to change the text and links in the sub-footer.

    When I did it in the original parent file, everything appeared in my front-end as I want it but I don’t want to do it again every time when the theme is updated, that’s why I created the child theme after the many advises in the forums.

    • This reply was modified 6 years, 11 months ago by mrblond.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Creating Child Theme functions.php’ is closed to new replies.