federicodimattia
Forum Replies Created
-
Hello Tom,
thanks for the quick answer.
My problem is that the method to load the child theme works partially, which means that it loads the settings of the parent theme (Twenty Twenty-One) BUT NOT the changes made by Twentig. Can you tell me why?I loaded just this file / code:
[file]
style.css
[code]
/*
Theme Name: My Twenty Twenty One Child Theme
Theme URI: https://example.com
Description: A child theme for Twenty Twenty One.
Author: Your Name
Author URI: https://example.com/
Template: twentytwentyone
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/[file]
function.php
[code]
function twentytwentyone_styles() {
wp_enqueue_style( 'child-style', get_stylesheet_uri(),
array( 'twenty-twenty-one-style' ), wp_get_theme()->get('Version') );
}
add_action( 'wp_enqueue_scripts', 'twentytwentyone_styles');Hi @linux-garage,
in functions.php file I pointed to the parent theme:<?php
/*FIRST: aggiungi il child-style*/
add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
function my_theme_enqueue_styles() {
wp_enqueue_style( ‘child-style’, get_stylesheet_uri(),
array( ‘parenthandle’ ),
wp_get_theme()->get(‘Version’) // this only works if you have Version in the style header
);
}