Viewing 11 replies - 1 through 11 (of 11 total)
  • Theme Author Shaped Pixels

    (@shaped-pixels)

    Thanks ??

    This should help to Make a child theme

    Thread Starter DanielCanDesign

    (@danielcandesign)

    Thanks but it did not help. After I activate child theme site is little crushed.

    Theme Author Shaped Pixels

    (@shaped-pixels)

    hmmm odd…try my setup tutorial for a child theme and see if that helps.

    Create Child Theme

    Thread Starter DanielCanDesign

    (@danielcandesign)

    Still something wrong, here: https://zdolnelapy.pl/projekty/moto-s/

    Theme Author Shaped Pixels

    (@shaped-pixels)

    Your style.css for the child theme looks right. Did you create a functions.php file in your child theme? This will inherit the parent theme “seasonal” style.css which is the element that is missing from your current site.

    In my tutorial, there’s a section in the page with a heading “Functions” that goes through this process.

    Thread Starter DanielCanDesign

    (@danielcandesign)

    Yes I did,

    <?php
    /**
     * Functions and definitions
     * @package Seasonal Child
     */
    
    // Lets begin by grabbing our stylesheet from the parent theme
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    
    // Load our main stylesheet
    wp_enqueue_style( 'seasonal-child-parent-css', get_template_directory_uri() . '/style.css' );
    }
    ?>
    Theme Author Shaped Pixels

    (@shaped-pixels)

    I just used yours in my local test site and it works, so why it’s not loading the parent’s stylesheet (which is what is missing) is puzzling me.

    Try this one:

    <?php
    /**
     * Functions and definitions
     * @package Seasonal Child
     */
    
    // Lets begin by grabbing our stylesheet from the parent theme
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    
    wp_enqueue_style( 'seasonal-style', get_stylesheet_uri() );
    
    wp_enqueue_style( 'seasonal-child-parent-css', get_template_directory_uri() . '/style.css' );
    
    }
    ?>
    Theme Author Shaped Pixels

    (@shaped-pixels)

    Just to confirm before you try my last reply, this in your functions.php does not work?

    <?php
    /**
     * Functions and definitions
     * @package Seasonal Child
     */
    // Lets begin by grabbing our stylesheet from the parent theme
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>
    Thread Starter DanielCanDesign

    (@danielcandesign)

    I am sorry. It is my mistake. I called file function.php not functions.php that is why it did not work.. Really sorry about that

    Theme Author Shaped Pixels

    (@shaped-pixels)

    No need to say sorry ??
    …So which code in your functions file are you now using?

    Thread Starter DanielCanDesign

    (@danielcandesign)

    <?php
    /**
     * Functions and definitions
     * @package Seasonal Child
     */
    // Lets begin by grabbing our stylesheet from the parent theme
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘child theme’ is closed to new replies.