• About & Contact Us
  • SEO Community

Ulancer.com

    • Latest Stories

      What is new?

    • Meet the startups that pitched at EF’s 10th Demo Day in London

      September 27, 2018

    • Rally Rd., the app that lets you invest in classic cars, raises $7M Series A

      September 27, 2018

  • News
  • How to’s
  • Writing
  • Startups
  • Jobs
  • More
    • CMS Tools
    • APPS
    • Web Resources
      • Advertising
      • Firefox
      • Scripts
      • Tools

How to Create a WordPress Child Theme

  • by Salman
  • In APPS
  • — 11 Jan, 2013

Creating a child theme is important if you like customizing themes. This give you the ability to use a theme you like as a base and apply any changes you want without disrupting the original code. This means you can update your theme and benefit from any bug fixes and improvements without losing your modifications. Now when making child themes, you have two options. You can make them manually and with a plugin. I’ll teach you how to do both.

Creating a Child Theme Manually

The first thing you have to do is create a folder to house your child theme’s files, lets call it “template-child”. In this folder, you’ll put the files you’re customizing. The only mandatory file when creating a child theme is the style.css file. Any other files like functions.php and template files like single.php and page.php are all optional.

Now in that style.css file you created for your child theme, you need to include the same header you would use in the parent template’s style.css with a little modification.
/*
Theme Name: Template Child
Template: parent-template-name-here
*/

The line I made bold is very important, its what separates a child theme’s style.css file from a parent theme’s style.css file. In your child’s style.css file, that line tells WordPress the name of the parent theme. That way, the child theme inherits template files from the parent theme. Very important and useful if you’re looking to change only the CSS or a couple template files.

Now if you’re only looking to modify a few things in your parent theme’s css, you don’t have to copy and paste that into the child theme’s css file. Instead, what you can do is import the original css into your child’s css file by adding this line to the style.css file:
@import url("../parent-template-name-here/style.css");

Now whatever CSS you want to change, you just add it below that @import command. This saves you quite a lot of time and makes the process quite simple.

If you choose to also include a functions.php file in your child theme, you don’t have to worry about adding any extra code to make sure everything works properly. The child’s functions.php file is loaded before the parent’s functions.php file, giving you an easy and effective way to modify the functionality of your theme.

If you’re done with the above steps, you’ve successfully created your first child theme. In order for your work to take effect, simply upload your child theme’s folder “template-child” to the same directory as the parent theme. Then just go to the Themes section in the admin panel and activate your child theme in order to see your work.

Creating a Child Theme with Child Themify

If you’d much prefer not getting your hands dirty in a bit of code, you can install Child Themify to create a child theme for you at the click of a button, as shown here:

This really speeds up the process and can be pretty useful if you’re in a hurry.

Tags: child temifychild themefunctions.phppage.phpparent themepluginsingle.phpstyle.csswordpress

You might also like...

  • SaaS Does Not Equal Software Sales 6 Apr, 2017
  • 10 latest WordPress Blog/Magazine Themes 21 Jan, 2013
  • Enhance Your WordPress Multisite With Beyond Multisite: 9 modules in 1 plugin 15 May, 2017
  • 10 Essential Tools Every Freelancer Needs 1 Jun, 2017
  • Previous story Freelance Tips: Making Sure You Get Paid On Time
  • Next story Free WordPress Theme Generator Sites
  • RSS
    Receive Freebies & Latest Posts Directly To Your Email - it's Free!

    • Recent Posts
    • Most Popular
    • Comments
    • 7hrCggmJ-AMMeet the startups that pitched at EF’s 10th Demo Day in LondonSeptember 27, 2018
    • oNo38LV2tQIRally Rd., the app that lets you invest in classic cars, raises $7M Series ASeptember 27, 2018
    • Nearby.gifBerkanan is a Bluetooth-powered group messaging appSeptember 27, 2018
    • 2122.pngVinay Gupta to talk about Mattereum at Disrupt BerlinSeptember 27, 2018
    • slider_wp_03Best collection of WordPress Slider PluginsJuly 5, 2010
    • Joomla template builderTop 8 Free Joomla Template GeneratorsJuly 19, 2011
    • 40+ Best WordPress Plugins for Comments40+ Best WordPress Plugins for CommentsJune 18, 2011
    • wptheme2A Collection of Free WordPress ThemesJuly 11, 2010
    • Bharat Sarkari Naukri on:Spotify acquires online music studio Soundtrap as it goes after creators
    • PMP on:Online learning platform Unacademy gets $21M Series C from Sequoia India, SAIF and Nexus
    • Predictive Eye on:Element.AI opens London outpost with focus on ‘AI for good’
    • SmartCursors on:4 Tips for Keeping Your Freelance Finances In Order
  • Staff Picks

    • slider_wp_03Best collection of WordPress Slider PluginsJuly 5, 2010
    • Joomla template builderTop 8 Free Joomla Template GeneratorsJuly 19, 2011
    • 40+ Best WordPress Plugins for Comments40+ Best WordPress Plugins for CommentsJune 18, 2011
  • Recent Posts

    • Meet the startups that pitched at EF’s 10th Demo Day in London
    • Rally Rd., the app that lets you invest in classic cars, raises $7M Series A
  • Search Our Blog

  • Ulancer is an insightful freelance blog and resource site. We provide intuitive articles that cover Photoshop tutorials, time-saving management tips covering a broad range of topics. We also have an active freelance community forum, there you can meet other freelancers that share your common interest, socialize and chat about freelance trending news as the occurred.

© Copyright 2013 Ulancer.