Twenty Twenty child theme doesn’t work
-
Hi,
I’m having some troubles creating a child theme based on Twenty Twenty theme.
After creating twentytwenty-child folder in “theme”, setting up function.php and style.css in it and setting the child theme on the backend, I can’t get it working.These are my style.css and function.php in my “twentytwenty-child” folder:
style.css
/* Theme Name: Twenty Twenty Child Theme URI: https://example.com/twenty-fifteen-child/ Description: Twenty Twenty Child Theme Author: lup0z Author URI: https://example.com Template: twentytwenty Version: 1.0.0 License: GNU General Public License v2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: twentytwentychild */
function.php
<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { $parenthandle = 'twentytwenty-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme. $theme = wp_get_theme(); wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', array(), // if the parent theme code has a dependency, copy it to here $theme->parent()->get('Version') ); wp_enqueue_style( 'twentytwentychild-style', get_stylesheet_uri(), array( $parenthandle ), $theme->get('Version') // this only works if you have Version in the style header ); } ?>
I’ve spent a lot of time searching for a solution in various websites, but I can’t make it work.
Thank you for your reply
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Twenty Twenty child theme doesn’t work’ is closed to new replies.