SOC09108 - 2015 - Practical 03

Extending WordPress: child themes

Open Laragon, and click on Shell to open the command line application. Following the WordPress boilerplate by Darep, clone the boilerplate on your machine.


      git clone --recursive git://github.com/Darep/wordpress-boilerplate.git soc09108/practical02
    

Note that we are using the clone command with a third parameter, in this specific case a path where we want to store the data cloned (targeted folder).

While the clone is processing (which takes time), go on Bitbucket if you have not created an account there already and create your account. Then create a new repository ( Create in the top toolbar, then Create repository ). You can set soc09108/practical02 as name, and leave all the settings by default and uncheck This is a private repository so you have no problems with authentication for now. If you need any help understanding what the options are and are interested in learning more on this subject please ask.

On the Repository setup page that will be displayed next, use the last link ( I have an existing project ) to retrieve the instructions you will need to add the boilerplate project to versionning. Back to the command line interface, you can now browse to the folder created while cloning the boilerplate:


      cd soc09108/practical02 .
    

Using git remote -v , have a look at the existing remotes for your project. By convention, origin is the main remote repository. You should have this result:


      origin git://github.com/Darep/wordpress-boilerplate.git (fetch)
      origin git://github.com/Darep/wordpress-boilerplate.git (push)
    

In your case, and in general, you do not want your changes to be pushed back to the boilerplate repository (unless you actually want to contribute to the boilerplate itself, in which case you may want to fork it first, read the beginners guide to contributing to a github project on Rob Allen’s blog if you are interested).

Here we will just remove the existing remote (git remote rm origin), git remote -v to verify it worked, and add the newly created repository on Bitbucket (git remote add origin git@bitbucket.org:_____________/set09108-practical02.git).

Note: the last command is the first command in the I have an existing project section on Bitbucket.

Finally, use git push -u origin --all as Bitbucket describes to send the boilerplate on your own repository.

Once this is done, refresh your page on Bitbucket and have a look at what you versionned.

In the .htaccess file , remove the RewriteBase / . Then edit your wp-config.php and commit and push on Bitbucket. (specifically database settings and define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/soc09108/practical02/wordpress');).

You can now complete your wordpress installation.

Use http://www.abrightclearweb.com/creating-child-theme-wordpress-twenty-fifteen/ to create your child theme (call it napier). For now, you can version this theme in the same repository, but eventually you may want to learn how to add your themes as submodules as well. You can use colorsafe.co to help you with accessible colours.

Fork me on GitHub