Title: Creating function.php file for child theme
Last modified: November 30, 2016

---

# Creating function.php file for child theme

 *  [darkstarx](https://wordpress.org/support/users/darkstarx/)
 * (@darkstarx)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/creating-function-php-file-for-child-theme/)
 * Greetings!
 * I have a question regarding the creation of a child theme from an unmodified 
   parent. In the Codex, there is a ‘How-To’ ([https://codex.wordpress.org/Child_Themes](https://codex.wordpress.org/Child_Themes))
   which I am following. In the how-to, the following statement is made regarding
   the creation of the functions.php file for the child theme:
 * > If your child theme style.css contains actual CSS code (as it normally does),
   > you will need to enqueue it as well. Setting ‘parent-style’ as a dependency
   > will ensure that the child theme stylesheet loads after it. Including the child
   > theme version number ensures that you can bust cache also for the child theme.
 * And the following example is shown:
 * <?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’ ); ?>
    -  **My question is:**
 *  Where exactly in the example shown does the ‘child theme version number’ go 
   and won’t the child theme version number be identical to the parent’s version
   number?
 * Thanks in advance for your support!
 * Frank

Viewing 1 replies (of 1 total)

 *  [LebCit](https://wordpress.org/support/users/lebcit/)
 * (@lebcit)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/creating-function-php-file-for-child-theme/#post-8498178)
 * Hello [@darkstarx](https://wordpress.org/support/users/darkstarx/)
 * It goes in the Child [Theme Stylesheet](https://codex.wordpress.org/Theme_Development#Theme_Stylesheet)
 * No the versions are not related.
 * I recommend you a [pretty good plugin to create a child theme](https://wordpress.org/plugins/child-theme-configurator/).
 * SYA 🙂

Viewing 1 replies (of 1 total)

The topic ‘Creating function.php file for child theme’ is closed to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [LebCit](https://wordpress.org/support/users/lebcit/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/creating-function-php-file-for-child-theme/#post-8498178)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
