• Very strange, the child doesnt work in this case, but its the exact copy of an earlier site that works perfectly. I cant get the styles I have in my child folder to have any influence over the theme.

    functions.php

    <?php
    /* enqueue scripts and style from parent theme */        
    function twentytwenty_styles() {
    	wp_enqueue_style( 'parent', get_template_directory_uri() . '/style.css' );
    }
    add_action( 'wp_enqueue_scripts', 'twentytwenty_styles');
    ?>

    style.css

    /*
    Theme Name: Accend Twenty Twenty Child Theme
    Theme URI: https://www.accend4web.co.uk
    Description: A child theme for Twenty Twenty.
    Author: Accend Web Solutions
    Author URI: https://www.accend4web.co.uk
    Template: twentytwenty
    Text Domain: twentytwenty-child
    Version: 1.0.0
    License: GNU General Public License v2 or later
    License URI: https://www.gnu.org/licenses/gpl-2.0.html
    */
    
    • This topic was modified 5 years, 9 months ago by accend4web.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sorry, I know we shouldn’t really add “me too”s, but, me too! Hope some one can give an answer to this.

    I found this

    <?php
    /**
     * Recommended way to include parent theme styles.
     * (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
     *
     */  
    
    add_action( 'wp_enqueue_scripts', 'twenty_twenty_child_style' );
    				function twenty_twenty_child_style() {
    					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') );
    				}
    
    /**
     * Your code goes below.
     */

    It doesn’t look like you have given the right file references. BUt I am a neophyte looking at this.

    I wrote too soon.

    I put your two files into a child theme and the change I put into the style file — p{color:purple} — worked. Perhaps you need to reinstall?

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

The topic ‘Enqueue not working in child theme’ is closed to new replies.