Quantcast
Channel: Andy Roberts » webhost
Viewing all articles
Browse latest Browse all 2

WordPress Child Themes Installed in One Click?

$
0
0

I’ve been requested to make a tutorial about how to install WordPress child themes so here goes.

WordPress Child Themes Explained

A WordPress Child Theme is a Theme which inherits some or most of its workings from an existing theme on the same installation. It’s like your own copy of another theme, a fork, a duplicate, but still relying on the original theme for many things.

Why you need a Child Theme

The reason why you need a child theme is so that you can make changes to the theme files, such as editing the stylesheet or adding code into the Header or Footer files, which won’t be overwritten if and when the Parent theme is upgraded.

If you understand Cascading Stylesheets ( CSS ) you can make changes and additions to the stylesheet which customise or improve the appearance of your site. You may also need to add bits of code into the header or footer files in order to call a script which can’t be done with a plugin, like Tynt or Crazy Egg for example. Or you might know just enough PHP to be able to go through the main files reducing the number of database calls to speed up your site by replacing the generic with the specific. If you don’t use a child theme then you run the risk of losing all your customisations when the parent theme is updated, or else getting stuck left behind with an out of date version of the main theme’s code.

How to do it

To make it as easy as possible I’m suggesting the use of a plugin to create your child theme, but for now, I don’t believe there is a way to do everything ( including the creation of new theme files) entirely within the WordPress dashboard yet, so you may still need to complete one or two simple steps using either the filemanager in the cPanel dashboard at your webhost or using FTP.

The plugin is called One-Click Child Theme and you can find it here: http://wordpress.org/extend/plugins/one-click-child-theme/

Install the plugin, activate, and then navigate to Dashboard, Appearance, Themes

With the theme you wish to create from active, you should now see an additional Option next to Widgets and Menus called Child Theme – see screenshot below:

 

So now you click on the link “Child Theme” which creates and activates your new child theme for you, after asking you for a name and description. Your new child theme will also have the link “Child Theme” but don’t click on that ever, or else you’ll create a grandchild, not really a good idea.

If you now go into the WordPress theme editor, Dashboard, Appearance, Editor you’ll see that there are only two files available with the new child theme – rtl.css and style.css
These are stylesheet files that call back to the parent theme, and it is by editing these files that you can add your own cascading styles for altering the appearance of your site and much more.

If you need to change other files such as header.php and footer.php, then you need to copy the parent files into the folder which has been created on your WordPress server at /content/themes/

Make a note of exactly what your child theme folder has been named, then go down into the original themes folder.

Select the file you need to copy, eg footer.php in the example in the screenshot below, then select the “Copy” action at the top. In the destination path box, overtype the parent name with the child name and press Copy. The copied file will now appear in the list of available files in the theme editor, where you can begin your customisations.

 

There are other plugins available, some of which claim to offer file copying options during the child theme creation process, but none have ratings and are untested by myself. If you have had success with any of these or any questions, please leave a comment below.

 

Thanks for subscribing to Andy Roberts blog

WordPress Child Themes Installed in One Click?

Technorati Tags: , , , , , , , , , , , , , , , , ,


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images