Author: Patrick Klein

Front-end web developer and Google certified SEO and SEA professional from the Netherlands working for a company that has been around for over 50 years with a specialty in PR and advertisement. In recent years we have also been working on getting beautiful websites up and running that are affordable for smaller companies.

Creating a Child Theme

When performing changes to your theme, like changing up the template; adding functionality; or adding CSS, it is often advised to use a child theme. But how do you make a child theme? What even is a child theme? Why do you need this? All questions that people new to this level of ClassicPress will come up against. This tutorial will do its best to answer these questions in the easiest way possible.

What is a child theme?

Simply said, a child theme is a theme that is dependent on another theme. The theme that the child theme is dependent on is called the parent theme. The child theme will pull its code from the parent theme to fill in any gaps. This will make it appear as if you’re using the parent theme.

So why use a child theme?

In the child theme you can overwrite templates, functions and CSS from the parent theme without actually changing the parent theme. This means that when you update the parent theme, these changes will remain in effect. So, you can safely make all the template, styling and functionality changes to a theme that you want, without having updates overwrite your efforts.

How do I make a child theme?

By now you should be convinced that if you are going to make changes to a theme, you should get a child theme. So let’s make one step by step.

What do I need?

  • Access to your ClassicPress files, either through FTP or a file manager.
  • A parent theme of your choosing. For this tutorial we will use Twenty Seventeen
  • A code/text editor.

The Tutorial

Step 1: Open your ClassicPress installation in FTP or a file manager and Navigate to wp-content > themes.

themes folder

Step 2: Create a new folder and access it. The name does not really matter, but for future reference, it is easiest to name this folder <themename>-child. So in this case it will be twentyseventeen-child.

child theme folder

Step 3: Create a file named style.css in the new folder and open it in an editor.

style.css

Step 4: Next we are going to create some theme details. Like below:

  • Theme Name => Your chosen theme name
  • Theme URL => Your URL
  • Description => A short description of the child theme
  • Author => Your name
  • Author URL => Your domain
  • Template => The folder name of your parent theme, in this case twentyseventeen, but this is different for each theme.
  • Text-domain => The folder name of your child theme, in this case twentyseventeen-child.

Note: Only Theme Name and Template are required, the rest is optional.

Now add these details to the style.css you created like below and save the file.

/*
Theme Name: Twenty Seventeen Child
Theme URL: https://www.classicpress.net/
Description: Example of a Child theme for Twenty Seventeen
Author: klein
Author URL: https://forums.classicpress.net/u/klein
Template: twentyseventeen
Text Domain: twentyseventeen-child
*/
/* You can add custom CSS below */
 

style header


Step 5:
Create a file named functions.php in the child theme folder and open it in an editor.

functions.php

Step 6: Add the following code to the functions.php file and save it.

<?php
//Enqueue parent theme css
add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_css’ );
function enqueue_parent_theme_css() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
}
//Add custom functions below
?>

enqueue parent style


Step 7:
Go to your ClassicPress admin area and go to themes. When here, ‘Activate‘ the child theme.


Step 8:
Your child theme is ready for use!

How do I start making changes?

Now that your child theme is ready for use, you obviously want to start making changes. As mentioned before, there are three main uses for your child theme: change styling, add functionality and edit templates. Doing these three things is easy!

Changing styles

To overwrite your theme’s CSS, simply go to the style.css file you made during the creation of this child theme. Add the CSS changes you want to this file below the details and save them!

Note: The child theme styles are rendered after the parent, so anything you add here will overwrite the specifications made in the parent’s style.css file.

Adding functionality

Often when you are trying to add functionality through snippets, you will be instructed to add them to your theme’s functions.php. It works the same way with a child theme. You can add these snippets or write your own in the functions.php file you made during the creation of this child theme. Just add them below the enqueue_parent_theme_css function.

Editing templates

To edit a template file you must first find the file in your parent theme. For example single.php, sidebar.php, footer.php, etc. When you have found the file you want to edit, make a copy and upload this copy to your child theme. Be careful to keep the URL structure intact! For example, if you found a file in the folder template-parts, make sure it’s also placed in a folder named template-parts in your child theme.

Some plugins also gives you the option to edit their templates in your child theme! An example of this is WooCommerce. To do this, you go to your plugin folder and look in the templates folder. Copy the file you want to edit. When in your child theme, make a folder with the same name as the plugin’s folder (This folder takes the place of templates in your URL structure) and add the copy of the file you wish to edit to this folder. Also make sure the URL structure stays intact from here, just like a theme file.

Note: Because the plugin folder in your child theme takes the place of templates, you do not need to add a templates folder in these plugin folders.

Meet the Community: Pete Thomas

ClassicPress Forum Handle: MrLucky
Websites:
CP: petethomas.co.uk, mediamusic.com, jazzyproductionmusic.com, otra.org.uk ;
WP: tamingthesaxophone.com, musicasecreta.com ;
Xenforo: Cafesaxophone.com
Where in the world are you located? South East England, UK

Tell us about yourself — occupation, hobbies, etc.

Musician and composer (semi retired). I was originally a pop/rock session and touring musician (saxophone) then became a composer of media and TV music.

Hobby: websites which are involved with fundraising for special needs music education (raised almost £1,000,000 to date)

I am also a supporter of Southampton FC.

What are some of your fundraising campaigns for?

As the sites that raise the money (the store site and the forum) are aimed at musicians it just seems natural to choose music related charities. And music education (and/or therapy) for special needs children and adults is something I’m interested in, there is so much to do with assistive technology that is advancing all the time.

You can find more information at: tamingthesaxophone.com/fundraising-on-the-site.

Other than the alarm clock, what gets you up in the morning?

My wife. Ugandan coffee.

What’s your dream job?

What I’ve been doing I suppose.

What led to your love for the saxophone, is it the only instrument you play?

What lead me to the saxophone? I think that was hearing some avant garde jazz on the radio (Ornette Coleman) when I was 18 and realising there was more to jazz than the boring trad my parents listened to.

And no, it is not the only instrument I play. I also play a bit of guitar, bass, keyboards and percussion. Plus programming. It’s very useful these days to be a multi-instrumentalist and being able to produce, for media companies, something that has real instruments, not just programmed synth and sample.

Where can people find your music?

A lot of my music, especially educational and sales is on my main site tamingthesaxophone.com, a lot more (the production music) can be found on jazzyproductionmusic.com.

How did you hear about ClassicPress, and what made you want to get involved?

I heard about it from the Wordpress Feedback forum. I was finding Gutenberg difficult to deal with.

How does ClassicPress fit into your overall plans for the future?

Gutenberg is too restricting. I want the combination of simple text editor but with the ability to use coding when I want to. I cannot see any longevity to the Wordpress classic editor plugin. My only reservations are that my main site (tamingthesaxophone.com) which is quite large and involves sales will need a lot of testing (plugins etc.) before I’m confident enough to migrate it to CP.

Done fast; done cheap; done well: what’s your choice(s) and why?

Each depending on context.

Meet the Community: Zulfikar Gani

ClassicPress Slack Handle: zulfgani
ClassicPress Forum Handle: zulfgani
Social media handles: @classicdesignr on Twitter, Zulfikar Gani on FB & zulfgani on GitHub.
Website: https://classicdesigner.co.uk (My ClassicPress home currently under construction)
Where in the world are you located? Leicester, UK ~ In the heart of England

Tell us about yourself — occupation, hobbies, etc.

I’m a bit of a jack of all trades so online I go by “A code wrangler” especially themes and plugins for ClassicPress having emigrated from WordPress last year. I’d love to build a full fledged web Agency based on ClassicPress and therefore working towards this as the end goal.

Offline I’m in the process of setting up a meat (beef) production unit where I’ll be producing halal beef bacon, sausages and gourmet burgers. As a former builder I’m doing most of the unit build work myself and as a coder will be responsible for the business website from A-Z.

What made you want to get into the meat industry and why specifically set up a halal production unit?

I was born in Tanzania, East Africa so grew up with cows and meat around me. I kinda lost touch with that when we moved to the UK. That though changed when I met an American lad and we became good friends. He and his friend had set up a butcher shop and from them I got to learn the American cuts, rubs and way of cooking steaks.

With that knowledge talking to fellow Muslims about steaks and especially bacon I quickly realized there was a huge gap in the market. So after a few more chats a couple of us decided that there’s a market out there, so why not fill it? And so the adventure began.

Other than the alarm clock, what gets you up in the morning?

It has to be thought of finally being able to enjoy a good ol’ full English breakfast 😉 So I get up early, do some code then rush off to get the production unit job done.

What’s your dream job?

I have 2 as mentioned above ~ currently working on getting them both off the ground 🙂

How did you hear about ClassicPress, and what made you want to get involved?

Ah, ClassicPress! We met by chance and it was code love at first site.

As a passionate themer I was in the habit of keeping up with WP development longing to find an opportunity to get back in. It was during one of the reads when I spotted a comment mentioning ClassicPress “without Gutenberg” and knew what I had to do, “get back to what I love doing”.

I’ve since released my first ClassicPress theme called GeneriK and I’m currently working on another 2 plus a couple of forked and improved/unGutenBerged (is that a word?) plugins.

What made you create GeneriK?

I had originally created a theme for WP with some basic Gutenberg support while it was still a plugin. I then realized that Gutenberg was going to be a nightmare to develop for let alone support so I shelved the project and also quit the WordPress Theme Review Team.

When ClassicPress presented me with the opportunity to get coding again I revived the theme, renamed it and stripped out all of the GB support ~ going back to the basics so to speak.

I’m very pleased with the end results but have more ideas to take the theme even further. I named the theme GeneriK (Generic) on purpose as it is very extensible via action hooks and filters. Child themes and addon plugins can really take it to the next level by adding, removing and hooking in to these actions to make it unique while the base theme still remains generic.

But the proof is in the pudding and only the end users of the theme can be the judges ~ I would naturally be biased.

How does ClassicPress fit into your overall plans for the future?

ClassicPress has rekindled my love of code and an ambition to run a web agency which I intend to capitalize on to the fullest extent as I grow.

Done fast; done cheap; done well: what’s your choice(s) and why?

Lets see, 
Done fast leads to silly mistakes and goes against the saying “never rush a good _____”
Done cheap is overrated. Wait, that’s underrat(ing)ed right?

For me it has to be “Done Well” as a well done pat on the back is more gratifying than a few “quick bucks”.

Meet the Community: Dick Metcalf

ClassicPress Slack Handle: Dick_Metcalf
ClassicPress Forum Handle: Dick_Metcalf
Facebook: facebook.com/dick.metcalf
Twitter: @rotcod2010
Website: contemporaryfusionreviews.com
Where in the world are you located? Washington, USA

Tell us about yourself — occupation, hobbies, etc.

I spent close to fifty years rovin’ around the world before finally deciding (in 2014) that it was time to hit the retirement trail. That was as a soldier, then a contractor, then a Department of the Army Civilian in the logistics career field.

During all that time, one of my most intense passions was music. The playing of it (back in the day), the recording and now, in my twilight years, writing about it. I actually started my original magazine, IMPROVIJAZZATION NATION, way back in 1990… and it’s still up and running. I like to think that my playing, though on an amateur level, gives me an “edge” over other music journalists. I performed on (over) 60 CD’s… You can hear (and download for free) many of those works at this “Internet Archive Collection”!

My involvement in web, database and enterprise networking activity from the early 1990’s all the way to now has helped me stay ahead of the game, even though I’ll be 73 years old this coming September.

Is IMPROVIJAZZATION NATION your only magazine?

No, I have started another. I had been running an online magazine called IMPROVIJAZZATION NATION since 1990, all for free in my spare time. When I retired from Federal service in 2014, I worked with my son to create a new magazine and called it Contemporary Fusion Reviews. Contemporary Fusion Reviews specializes in music reviews and is designed to provide some expedited and expanded review services that many players and promoters have been discussing with me for about ten years now.

You clearly have a big love for music, who are your favourites?

It’s a diverse group, to be sure… For example Jimi Hendrix, Eddie Harris, Les McCann, Aretha, Funk-a-delics and on and on.

Other than the alarm clock, what gets you up in the morning?

The smell of espresso… and then it’s off to writing music reviews.

What’s your dream job?

It’s the job I have right now… writing music reviews for a “contribution-based” model. All at my own pace, for a little coin and a lot of GREAT music!

You have the nickname Rotcod Zzaj, where did that come from?

The “Rotcod Zzaj” name was from some young black dudes who were watching me play keyboards in an overseas Service Club for us military types in Pyongtaek, Korea… They were stoned out of their minds, and sat at rapt attention as I played my original jazz pieces on the piano. When I was done, they said they were going to call me “Doctor Jazz” from that point on. But a couple of weeks later, I was playing there again, and the same two cats showed up, weeded out again… they told me that they’d been thinking about it, and that my music was cool, but that it somehow sounded like “backwards jazz”… We discussed it and turned the letters in Doctor Jazz around to fit their perceptions. So, thereafter, I was known as Rotcod Zzaj.

How did you hear about ClassicPress, and what made you want to get involved?

I was searching the web for alternatives to WP 5.0/Gutenberg, because I had tested G-berg and was TERRIBLY disappointed with it. I also loved the idea that CP is truly community-based, and it appears that it will stay that way for the long-term.

How does ClassicPress fit into your overall plans for the future?

I run 5 websites; CP is deployed on all of them, and will remain that way for the long term. I’m finding out (from my son and others) that you never stop learning in the world of the net.

What is your experience with and opinion of the community?

My experiences with the CP community have been both rewarding and helpful in all respects. I was particularly impressed with the way James Nylen jumped in with both feet and helped me solve a site problem I had. But, more than that, there just seems to be a great sense of “helping each other out”, a true treasure!

Done fast; done cheap; done well: what’s your choice(s) and why?

Done well… In fact, CP has proven that “well” is always better. Every upgrade I’ve run has gone seamlessly, and it can’t be beat! That’s my opinion of course.

Meet the Community: Nerissa McCanmore

ClassicPress Slack Handle: none
ClassicPress Forum Handle: Nyssa The Hobbit
Social media handles: Nyssa the Hobbit (@NyssaTheHobbit) on Twitter
Website: https://nyssashobbithole.com
Where in the world are you located? USA

Tell us about yourself — occupation, hobbies, etc.

I am a housewife/mother, writer/novelist and blogger. I like to read (especially old/modern classics and gothics), tinker with my site, ride my bike on the trails around town, listen to Goth/Industrial and rock/metal and I also blog.

You mentioned you like to read, any recommendations or favourites?

Some of my favorites are Clarissa by Samuel Richardson, Jane Eyre, the works of Jane Austen and Diana Gabaldon, The Time Machine by HG Wells, The Trial by Kafka, the Lord of the Rings trilogy.

Other than the alarm clock, what gets you up in the morning?

My cat Creamsicle (who must be fed). Creamsicle is a red tabby of about 2 years old or so. She’s a rescue so we don’t know the exact details. We’ve had her for a year and a half. She was a stray who didn’t seem as comfortable with humans at first. But now that she’s settled in, she’s happy and loving.

What’s your dream job?

Novelist. Alternately, library clerk or proofreader.

How did you hear about ClassicPress, and what made you want to get involved?

Through blog posts discussing the horrors of Gutenberg. I didn’t totally hate Gutenberg, but through testing I soon discovered that I couldn’t do everything I needed to do. Also, the attitude of some Wordpress people was a turn-off.

How does ClassicPress fit into your overall plans for the future?

I hope to use it to keep my website and blogs running smoothly.

You’ve mentioned your blogging quite a bit, what do you blog about and where can we read it?

The blog is hosted on nyssashobbithole.com. And, like it says on the blog, “Nyssa’s Hobbit Hole covers various topics–book reviews, religion, abuse, narcissism, college memoirs, Goth, politics, writing, etc.” Beside that I also do travelogues. I’ve been running it for 10 years now. I also have a writing blog focused on my writing projects and the act of writing itself.

Speaking of writing, you are also the author of two books, what can you tell us about that?

Tojet is a fantasy romance; The Lighthouse is a collection of Gothic stories. I self-published them while my son was small and I didn’t have time to look for traditional publishers. The fantasy was based on a dream I had in 1996, while the other is largely made up of dream-based stories that I started writing in the early 90s. In those days publishers didn’t like novellas or long short stories, so I put them together into one book with a central theme, a club for the paranormal and the strange.

Done fast; done cheap; done well: what’s your choice(s) and why?

I like all three together the best. 🙂

Meet the Community: Lesley Jones

ClassicPress Forum Handle: Zooey
Website: http://elements.uk.com/wordpress/
Where in the world are you located? England, UK

Tell us about yourself — occupation, hobbies, etc.

I took early retirement from Project Management Support nearly four years ago. When I first started in Personnel, it was my dream job, but things changed rapidly once we were privatized. I found myself changing roles every single year, just to stay one step ahead of redundancy. I became a Billing Specialist and loved it, but eventually that was outsourced to India, along with almost every other admin job. I was retained, but by then bullying had become rife and was taking a serious toll on my health.

Other than the alarm clock, what gets you up in the morning?

Our assorted zoo, which at the moment comprises 11 cats (mostly rescues from Eastern Europe), 6 rescued ferrets (who have the run of their own room), 2 llamas and 4 Golden Guernsey goats. We have had more – up to 18 cats at one time, 17 ferrets, a rescued pig, ex-battery hens and a fully grown green iguana (who also had her own room converted into a giant vivarium).

How did you end up with an entire zoo of animals?

I wish I knew! Many came from the newsgroups at work, when we were still allowed newsgroups. I think that accounted for our oldest cat (Merlin is now 17), our pig, our iguana Eddie Lizard and the first batch of ex-battery hens. I have also been a home checker for rescue centres and Cat’s Protection. I once transported a cat for our local CP (That’s Cat’s Protection, not ClassicPress), stopped for a break on the way home and the cat stayed until the end of her days. She gave us two unexpected kittens a few weeks later, which we also kept. We belong to two ferret rescue groups and we used to do public relations at various country shows. That involved handing our ferrets to anyone who wanted a cuddle and answering any questions.

What’s your dream job?

I’m doing it now. Caring for our zoo and my passion for photography. I have a full frame DSLR and in a few days I will be off for a week of landscape photography from Northumberland to the Western Highlands, the Isle of Skye and back home via the Lake District. I have a detailed itinerary which begins every day with “Get up at 04:00”. I also love street photography and try to get up to London once every couple of years. Recently my husband bought me a bridge camera which I take to local wildlife reserves. In the past couple of years I’ve seen and photographed kingfishers, hares, almost half the species of UK butterflies, dragonflies/damselflies and all kinds of assorted bugs. Last summer I was having lunch while sat on top of a hill surrounded by literally hundreds of butterflies. You can’t get an office better than that!

What sparked your interest in photography?

My Dad used a cine camera for as long as I can remember. I always wanted to be like him, so I saved up my birthday money and bought myself a Kodak Instamatic when I was about seven. I still have it today. My work horse used to be a 1980 Olympus OM2n until a friend sent me a link to a Guardian/Sony photography competition which, to my amazement, I won. I was always a fan of film photography (and in fact, I also own a 1940 Leica IIIb), but the prize was a digital Sony A700. I had a rather steep learning curve, but now that camera is 12 years old. I have since upgraded to a Nikon D800. The quality is superb, but the downside is the extra weight. I expect to feel like a packhorse during my trip to Scotland.

How did you hear about ClassicPress, and what made you want to get involved?

I’m not a technical person and built my own website as a “display cabinet” for my images. It took a year of hard work, but no sooner had I finished than I heard about the Gutenberg changes. I read as much as I could, but didn’t understand enough to make an informed decision. My gut feeling (as it remains today) was that it was wrong and broke trust within the WP community. I found the ClassicPress site by accident.

How does ClassicPress fit into your overall plans for the future?

I hope I will be able to use it in the future! I do however, as a blogger and photographer, still fret about the necessary tools (like a good image gallery) that someone like me will need. But I must say that so far the community has looked after me very well and I don’t worry too much.

You gave us a picture of a chicken to use, can you tell us about this photo and why you use it as an avatar?

Coral was one of the last ex-battery rescues before the enriched cage law came into force in 2012. I think her story is best summed up in a blog post I wrote about her not long afterwards. I guess I use it as an avatar to remind myself that although rescuing one animal won’t change the world, you can change the world for that one animal.

Done fast; done cheap; done well: what’s your choice(s) and why?

I’m a perfectionist with my photography, so it would have to be a job done well! Although as a retired person with so many mouths to feed, I do have to watch the pennies.