Title: Installing child theme using functions.php
Last modified: January 8, 2017

---

# Installing child theme using functions.php

 *  [edavenport](https://wordpress.org/support/users/edavenport/)
 * (@edavenport)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/)
 * _[ Moderator note: [moved to Fixing WordPress](https://wordpress.org/support/topic/please-use-how-to-and-troubleshooting-if-you-have-problems-after-installation/).]_
 * Hello All!
 * I am trying to make a child theme for the theme Illdy. I have read that it is
   faster and better to enque code from functions.php of the parent to the child
   which then will automatically upload style.css folders.
 * My questions are, is this true or are there more steps needed to be taken?
 * And also, what is the code needed to be put in the child’s function.php? Is it
   universal for all themes or is this theme specific?
 * Thank You!
    Eric

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [edavenport](https://wordpress.org/support/users/edavenport/)
 * (@edavenport)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8630805)
 * This is the code I have placed in the child theme’s function.php folder that 
   I created on file manager through cPanel:
 * // enqueue styles for child theme
    // @ [https://digwp.com/2016/01/include-styles-child-theme/](https://digwp.com/2016/01/include-styles-child-theme/)
   function example_enqueue_styles() {
 *  // enqueue parent styles
    wp_enqueue_style(‘parent-theme’, get_template_directory_uri().’/
   style.css’);
 * }
    add_action(‘wp_enqueue_scripts’, ‘example_enqueue_styles’);
 * The theme is still not loading on the dashboard stating that the stylesheet is
   missing. How do I go about adding the style sheet using functions.php for a faster
   loading?
 * Thank you!
 *  [Edwin Xico (XicoOfficial)](https://wordpress.org/support/users/xicoofficial/)
 * (@xicoofficial)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8631678)
 * Hi [@edavenport](https://wordpress.org/support/users/edavenport/)
 * Have you checked this guide on [Child Themes](https://codex.wordpress.org/Child_Themes)?
   I think it will answer most of your questions on Child Themes.
 * Cheers!
 *  Thread Starter [edavenport](https://wordpress.org/support/users/edavenport/)
 * (@edavenport)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8631714)
 * Awesome, yes this is very helpful.
 * One problem I’m running into with the file manager is that I have made a functions.
   php and a style.css under the new Illdy-child. Both of these are empty but 4 
   KB files. When I try to edit them I receive this message:
 * You cannot open this file because it is either a directory or a file larger than
   one megabyte (1 MB). To edit the file, download it and use a local editor.
 * But the download button is greyed out and inactive so I can’t download them either.
   Is it ok to compress them into a zip file?
 *  [Edwin Xico (XicoOfficial)](https://wordpress.org/support/users/xicoofficial/)
 * (@xicoofficial)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8631746)
 * It’s totally ok to compress them into a zip file.
 * But if they are empty it might be easier to just delete those two files and create
   two new ones.
 *  Thread Starter [edavenport](https://wordpress.org/support/users/edavenport/)
 * (@edavenport)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8631752)
 * I made zip files of functions.php and style.css in the child themes folder. In
   the functions.php I copy and pasted:
 *     ```
       <?php
       function my_theme_enqueue_styles() {
   
       $parent_style = ‘parent-style’; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme.
   
       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 ),
       wp_get_theme()->get(‘Version’)
       );
       }
       add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
       ?>
   
       and in the style.css I put:
   
       /*
       Theme Name: Illdy Child
       Theme URI: http://livingleashless.com/Illdy-child/
       Description: Illdy Theme
       Author: Colorlib
       Author URI: http://colorlib.com
       Template: Illdy
       Version: 1.0.35.2
       License: GNU General Public License v2 or later
       License URI: http://www.gnu.org/licenses/gpl-2.0.html
       Tags: blog, e-commerce, portfolio
       Text Domain: illdy
       */
       ```
   
 * _[Moderator note: code fixed. Please wrap code in the backtick character or [use the code button](https://codex.wordpress.org/Forum_Welcome#Posting_Code).]_
 * But under appearance>themes I get this message:
 * Template is missing. Standalone themes need to have a index.php template file.
   Child themes need to have a Template header in the style.css stylesheet.
 * What else needs to be added to complete the child theme?
 * Thank you!
    -  This reply was modified 9 years, 5 months ago by [edavenport](https://wordpress.org/support/users/edavenport/).
    -  This reply was modified 9 years, 5 months ago by [edavenport](https://wordpress.org/support/users/edavenport/).
    -  This reply was modified 9 years, 5 months ago by [bdbrown](https://wordpress.org/support/users/bdbrown/).
 *  [Edwin Xico (XicoOfficial)](https://wordpress.org/support/users/xicoofficial/)
 * (@xicoofficial)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8632075)
 * Hi [@edavenport](https://wordpress.org/support/users/edavenport/)
 * Your _functions.php_ looks fine, and the only required child theme file is style.
   css.
 * I noticed that you have `Template: Illdy`and it should be `Template: illdy` with
   a lowercase **i**.
 * Try to make that change and see if it works.
    -  This reply was modified 9 years, 5 months ago by [Edwin Xico (XicoOfficial)](https://wordpress.org/support/users/xicoofficial/).
 *  Thread Starter [edavenport](https://wordpress.org/support/users/edavenport/)
 * (@edavenport)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8633066)
 * [@xicoofficial](https://wordpress.org/support/users/xicoofficial/) thank you 
   for the responses!
 * I made the change to a lowercase i, but the problem still persists and am getting
   this same message:
    Template is missing. Standalone themes need to have a index.
   php template file. Child themes need to have a Template header in the style.css
   stylesheet.
 * Do I need to make an index.php folder as well? I don’t understand why wordpress
   thinks it is a standalone theme when it has been enqueued to the parent?
 * I also noticed that in the .php code I copied and pasted it had the generic ‘
   twenty fifteen’ examples, but I changed these to illdy but am still having problems.
 *  [Edwin Xico (XicoOfficial)](https://wordpress.org/support/users/xicoofficial/)
 * (@xicoofficial)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8635792)
 * Hi,
 * That is very strange.
    Since you are just starting the child theme I would advice
   to edit the sytle.css file with just this information:
 *     ```
       /*
       Theme Name:     Illdy Child
       Description:    Illdy Child Theme
       Author:         colorlib.com
       Template:       illdy
       */
       ```
   
 * It should work, and then add the rest of the information line by line and notice
   when it breaks.
 * You can do that with the funtions.php file as well.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Installing child theme using functions.php’ is closed to new replies.

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 2 participants
 * Last reply from: [edavenport](https://wordpress.org/support/users/edavenport/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/installing-child-theme-using-functions-php/#post-8631752)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
