Trouble Making Child Theme with Sketch
-
Hi, I upgraded to hosting to make the child theme, but I am having problems. I created a style.css and functions.php file in the root directory of sketch-child, but the dashboard tells me that the theme is broken because the stylesheet is missing.
I used this info for styles
/*
Theme Name: Sketch Child
Theme URI: https://jennifer.deliciousdesign.ca/sketch-child
Description: Sketch Child Theme
Author: Susan Bates
Author URI: https://deliciousdesign.ca
Template: sketch
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, full width, two-columns, right-sidebar, responsive-layout, accessibility-ready, portfolio
Text Domain: sketch-child
*/and this info for functions
<?php
function theme_enqueue_styles() {$parent_style = ‘parent-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 )
);
}
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
?>
<?phpI got this info from www.ads-software.com – how to create a child theme. Upon reading it said that if your theme has two stylesheets, you have to enqueue them separately, but I have no idea how to do that. The other stylesheet is rtl.css
Next I tried using the simpler code on the WP codex for functions but still got the same error.
<?php
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );}
?>I also tried putting the rtl.css in the sketch-child folder, but that didn’t work either.
Please help.
- The topic ‘Trouble Making Child Theme with Sketch’ is closed to new replies.