Creating your own WordPress child theme

When building my first WordPress child theme I ran into a road block pretty fast. The concept of building a child seemed fairly simple all you need to was make a style sheet and have it a folder within your themes folder. However in order for WordPess to pickup your child theme in the section of you install, your style sheet requires the following:  Theme Name, Theme URI, Description, Author, Author URI, Template, Version, Tags, and Text Domain. If you get any one of these incorrect, your child theme will not work. This was the case for me, I knew I was very close but some reason I couldn’t get it just right.  So I did what everyone does when they get stuck on something with WordPress, search for a plugin.

how to build a WordPress child theme

Picture from musepeep.com

It didn’t take long and I found one. One-Click Child Theme this plugin saves allot of time, all you have to do is install it. Then in the themes menu will have a new submenu called “Child Theme”. Clicking on that will give you a form that will allow you to make a child theme based on the current active theme. So you will have to theme you want to make a child theme active. This is how built the Catch Kathmandu child theme. So once you choose this, the plugin will build the style sheet for you and setup the file structure. Then all you need to is add your custom css to the style sheet, build custom page template, or do whatever is you wanted to do to customize the theme.

The best reason for building a child theme is because, you will be able to customize the theme to your liking. Then not have to worry about changes being lost in the next theme update. If you have any questions please feel free to comment below or reach to me through social media.

Advertisements

Ryans Catch Kathmandu Child Theme

Dorr Directory was generated using ryans catch kathmandu child theme

Dorr Directory

After posting a few times on the wordpress.org theme support section regarding Catch Kathmandu being full width. I noticed other people were having the same issue as I was. To me the option for no side bar means full width. So I thought I would try make a my own custom page template, and I succeed and the custom page template worked nicely. However when the Catch Kathmandu theme updates I lost my theme as a mod later pointed out to me. I was told and saw other people were being told in order to keep the page template you would have to create your own child theme.

So I did. I tried it out it works nice. The only thing I noticed is that the header logo went away once I activated the child theme. This was an easy fix I just re-updated my logo and everything worked fine. If you want to try my child theme you can do so by the below link. Just note this is my first child theme, it was only designed to make a full width page in the Catch Kathmandu  theme.

Click Here

Catch Kathmandu or Catch Kathmandu child theme Catch Kathmandu pro you decideSome make basic things about it out. In order for it work you of course have to the Catch Kathmandu  theme installed first. Then to use it, simply go to the page you want to make full width in the admin view of WordPress, Then in the Page Attributes box select the “Ryan is Awesome” in the template box. You can rename the template if you want to by editing the fullwidth.php file. If you have any basic questions feel free to comment blow.

Also note that the Pro version has this feature in it with along list of other features. Their version is fully supported this one is not.

Catch Kathmandu theme Full Width

To make a truly full width page in Catch Kathmandu, I had to make a custom page template. This is very easy to do if you have cpanel or ftp access to your hosting account. All you do do is make a file in this case we will call it “fullwidth.php” then paste in the text below. Once you do this upload this to your site/wp-content/themes/catch-kathmandu. Once you do that just choose it as a page template. If you have questions let me know. See example here


<?php
/**
Template Name: Ryan is Awesome
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package Catch Themes
* @subpackage Catch Kathmandu
* @since Catch Kathmandu 1.0
*/

get_header(); ?>

<div id="primary2" class="content-area">
<div id="content" class="site-content" role="main">

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'page' ); ?>

<?php comments_template( '', true ); ?>

<?php endwhile; // end of the loop. ?>

</div><!-- #content .site-content -->
</div><!-- #primary .content-area -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>