• Resolved Platoscave

    (@platoscave)


    I am trying to set up a child theme for primer. I know that this should be extremely simple, but I am struggling and would be very appreciative of any help you could give.

    This is what I’ve done thus far:
    1) Created a folder called primer-child-hp
    2) created a file called style.css with the following in it.
    /*
    Theme Name: Primer Child Theme
    Template: primer
    Version: 1.0.0
    */

    3) I have created a functions.php file with the following in it:

    <?php
    function mychildtheme_enqueue_styles() {
    $parent_style = ‘primer’;

    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 )
    );
    }
    add_action( ‘wp_enqueue_scripts’, ‘mychildtheme_enqueue_styles’ );
    ?>

    I have tried many different variations of this, but what should the $parent_style equal?

    Is that what I am doing wrong?

    Thank you very much in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create a child theme’ is closed to new replies.