Title: Adding child theme
Last modified: August 31, 2016

---

# Adding child theme

 *  Resolved [amylkirst](https://wordpress.org/support/users/amylkirst/)
 * (@amylkirst)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/adding-child-theme/)
 * I’m trying to add a child theme, but I can’t enqueue my styles. The code provided
   by WP doesn’t work and I can’t find where you enqueue your stylesheet in the 
   function theme.
 * What do I need to do in my functions.php file to bring in my child theme?

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

 *  [ThePixelMe](https://wordpress.org/support/users/thepixelme/)
 * (@thepixelme)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/adding-child-theme/#post-7143470)
 * > The code provided by WP doesn’t work and I can’t find where you enqueue your
   > stylesheet in the function theme.
 * The codes that you saw on WP Codex didn’t work for Smallblog theme is because
   Smallblog loads its styles differently from the standard themes.
 * Smallblog’s way of loading styles is actually the **opposite** of the standard
   themes. (I don’t know why the Smallblog theme author did that though; probably
   because he/she thought that it’d be fun to throw off novice developers or something
   along that line, haha.)
 * .
 * Smallblog parent theme’s style is set to load regardless of whether you enqueue
   it in your child theme or not.
 * On the other hand, it won’t automatically load your child theme’s style.css. 
   And if you put the parent-theme’s styles as a dependency of the child-theme’s
   styles in your child theme’s functions.php (like how the WP Codex instructed 
   on the second way to enqueue), then the parent theme’s styles would still load
   after the child-theme’s styles, effectively overwriting the child-theme’s styles.
 * That behavior is the opposite of any other standard theme.
 * .
 * So you’ll need to do the opposite of WP Codex’s instruction. WP Codex tells you
   to enqueue the parent theme’s styles. So the opposite of that would be to completely
   ignore the parent-theme’s styles and enqueue only the child theme’s styles, like
   this:
 *     ```
       <?php
   
       function smallblog_child_scripts() {
       	wp_enqueue_style( 'smallblog-child', get_stylesheet_directory_uri() . '/style.css' );
       }
       add_action( 'wp_enqueue_scripts', 'smallblog_child_scripts', 20 );
   
       ?>
       ```
   
 * ^ Add that to your child theme’s functions.php file.
 *  Theme Author [monkey-themes](https://wordpress.org/support/users/monkey-themes/)
 * (@monkey-themes)
 * [10 years ago](https://wordpress.org/support/topic/adding-child-theme/#post-7143769)
 * Thank you very much ThePixelMe for your feedback and sharing of your view.
 * [@amylkirst](https://wordpress.org/support/users/amylkirst/) plz let us know 
   if you have any more questions.
    Cheers
 *  [dada1978](https://wordpress.org/support/users/dada1978/)
 * (@dada1978)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/adding-child-theme/#post-7143827)
 * > <?php
   > function smallblog_child_scripts() {
   >  wp_enqueue_style( ‘smallblog-child’, 
   > get_stylesheet_directory_uri() . ‘/style.css’ ); } add_action( ‘wp_enqueue_scripts’,‘
   > smallblog_child_scripts’, 20 );
   > ?>
 * Thanks so much! The PixelMe! This worked!

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

The topic ‘Adding child theme’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/smallblog/1.5.8/screenshot.png)
 * Smallblog
 * [Support Threads](https://wordpress.org/support/theme/smallblog/)
 * [Active Topics](https://wordpress.org/support/theme/smallblog/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/smallblog/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/smallblog/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [dada1978](https://wordpress.org/support/users/dada1978/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/adding-child-theme/#post-7143827)
 * Status: resolved