• Resolved ragulin

    (@ragulin)


    Hi, Im trying to make child theme, but I am failing somewhere. It is my first child theme creation, so I am not sure if Im doing everything right. I made a folder in wp-content/themes…I named it baskerville-child and added a style.css file in this folder. The style contains:

    /*
    Theme Name: Baskerville
    Theme URI:  https://www.andersnoren.se/teman/baskerville-wordpress-theme/
    Description: Baskerville child theme
    Author: Anders Noren
    Editor: ****
    Author URI: https://www.andersnoren.se/teman/baskerville-wordpress-theme/
    Template: baskerville
    Version: 1.0.0
    */
    
    @import url(?https://pizza-zdice.cz/www/wp-content/themes/baskerville/style.css“);
    
    /* =úprava ?ablony zaèíná za touto èarou:

    Where is my mistake? Thanks for help

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can’t use fancy quotes in your @import line; they must be straight quotes. You should use a plain-text editor like Notepad when you create your child theme’s files.

    Hello, In your style.css, your child theme name as same as original name. So it’s not working. Change the Theme name as below:

    /*
    Theme Name: Baskerville Child
    
    */

    Next, delete your @import url …line and instead create functions.php ie same directory as style.css. And add following code inside functions.php:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles');
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css');
    
    }
    ?>

    I hope it will help resolve your issue.

    Thread Starter ragulin

    (@ragulin)

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating child theme’ is closed to new replies.