Create a WordPress child theme

Providing a starting point for the child theme, which can be activated in wp-admin and then worked on. Requiring only two files style.css and functions.php

Create style.css

/*
Theme Name: New Theme
Theme URL: 
Description: Twenty Seventeen Child Theme
Author: Clint Vidler
Author URL: https://vidler.app
Template: twentyseventeen
Version: 0.1.0
Text Domain: 
*/Code language: JSON / JSON with Comments (json)

Create functions.php

// Enqueues the stylesheet of the parent theme

<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );

function enqueue_parent_styles() {
    wp_enqueue_style( 'parent-style', 
    get_template_directory_uri().'/style.css' );
}
?>Code language: PHP (php)

Resources

GitHub repository

You may also find this article helpful. Explaining the correct method for enqueuing WordPress child theme styles and scripts.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.