Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Frankzappafication

    (@frankzappafication)

    this is the contents of the 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' );
    
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        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')
        );
    }
    Thread Starter Frankzappafication

    (@frankzappafication)

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

    RESOLVED IT

    Hi,

    Indeed, just one of those functions is correct. Declaring a function twice will throw a PHP error.

    And great that you are inserting the parent stylesheet the correct way and not using @import in your child theme’s style.css file! 🙂

    Regards,

    Oliver

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘child theme not working – functions.php’ is closed to new replies.