Sometimes, you may want to modify a WordPress theme. The best practice for modifying a theme's style and functionality is through a child theme to prevent your changes from being lost when performing updates.
/* Theme Name: Twenty Fifteen Child Theme URI: http://example.com/twenty-fifteen-child/ Description: Twenty Fifteen Child Theme Author: John Doe Author URI: http://example.com Template: twentyfifteen Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: twenty-fifteen-child */
Make sure to replace the information in the example with the information relative to your theme.
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
?>
Article ID: 1226
Created On: Tue, Nov 17, 2020 at 6:52 PM
Last Updated On: Tue, Nov 17, 2020 at 6:52 PM
Online URL: https://www.heartinternet.uk/support/article/create-a-child-theme-for-wordpress.html