Making a child theme for WP-Script themes
1 min read

Making a child theme for WP-Script themes

How to make a child theme for WP-Script

The code provided in this post is going to be for Retrotube but you can apply it to any theme as long as your rename everything appropriately.

    1. Login to your server and navigate to /wp-content/themes/
    2. create a new directory and name it “retrotube-child”
    3. instead of /wp-content/themes/retrotube-child:
      1. create functions.php
      2. create style.css

 

functions.php

<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    $parenthandle = 'parent-style'; 
    $theme = wp_get_theme();
    wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', 
        array(),  
        $theme->parent()->get('Version')
    );
}
?>

style.css


Theme Name:   Retrotube Child Theme
Theme URI:    https://www.thepornbiz.com
Description:  A Retrotube Child Theme 
Author:       WPBeginner
Author URI:   https://www.wpbeginner.com
Template:     retrotube
Version:      1.0.0
Text Domain:  retrotubechild

Your child theme is done. You can now change your appearance > theme to retrotube-child. Any time you want to modify a template, you simply copy the file from the mother theme. For example, if you want to edit /retrotube/template-parts/content-video.php, then you would copy it to /retrotube-child/template-parts/content-video.php

Leave a Reply

Your email address will not be published. Required fields are marked *