For this tutorial we’re going to use the Genesis Sample child theme from StudioPress to walk you through the process, step-by-step on how to rename a Genesis child theme.
Before we begin, let me provide 2 warning messages to you:
- Do not, I repeat, do not attempt to rename a child theme that is currently activated. It will fail and likely cause your website to incur the WordPress white screen of death.
- This tutorial is specific to Genesis child themes created by StudioPress. The steps I’m going to detail below will likely work with other themes built for the Genesis Framework, but I cannot guarantee it. There are simply too many variables at play.
Step 1: Rename the Folder
The first thing we do is to rename the folder that contains all of the child theme files. So in our example we will rename the folder named genesis-sample to wpsyntax.
Step 2: Functions.php
Next we go into the folder now called wpsyntax and look for the file named functions.php.
Open functions.php in your favorite text editor (I prefer Coda) and look for 3 variations of the old child theme name which is Genesis Sample. One variation is two words ‘Genesis Sample’ and the other two variations are ‘genesis_sample’.
Line 6: Genesis Sample
Line 11: genesis_sample_google_fonts
Line 12: genesis_sample_google_fonts()
Rename them to the following:
Line 6: WPSyntax
Line 11: wps_google_fonts
Line 12: wps_google_fonts()
Take note that I’m prefixing the function named google_fonts() with three letters. The three letters wps is short for WPSyntax. It’s best practice to prefix all functions in your code as to not conflict with WordPress core, other plugins and themes.
When you’re done it should look like the image below.
Since the Genesis Sample theme is a minimum theme (a starter theme), there is only one function that needs to be renamed. Other themes would require that you rename more than one function. So if you’re using a different theme, please make sure to rename all functions found in the functions.php file to your new theme name.
Step 3: Style.css
Next, you need to open style.css and once again you will search for Genesis Sample and rename all instances to WPSyntax.
Since the Genesis Sample theme is a bare-bones starter theme, there are no other changes to make in the stylesheet. You are technically done learning how to rename a Genesis child theme!
However, please note that other child themes built by StudioPress and third-party theme builders will most definitely have more style names that need to be changed.
Let me show you an example using the Minimum child theme from StudioPress just so everyone is clear.
That stylesheet contains the following:
which would need to be changed to
So with other child themes, you simply perform a find/replace to change the default theme name to your new custom theme name.
What about other labels such as Description, Theme URI, Author, Author URI and more? I’m glad you asked. If you’re learning to rename a Genesis child theme for the purpose of white labeling your theme, you should rename everything related to StudioPress to the name of your choosing.
A Note About Internationalizing And Localizing Your WordPress Theme
To keep this tutorial as simple as possible, I did not discuss internationalizing and localizing your child theme.
Just know that if you simply want to rename a Genesis child theme the instructions above are sufficient. If however, you want to localize/internationalize your theme, please read this article or head on over to the WordPress Codex for information on translating WordPress.
What If Another Theme Exists on WordPress with Same Name?
If you happen to name your theme the same name as a theme in the official WordPress Theme Directory, you will need to make one adjustment to your functions.php file. Copy/paste the code below into your functions.php or a functionality plugin.
Source code credit: Mark Jaquith
If you run into problems, drop me a note in the comment section below. I’m happy to help.The article How to Rename a Genesis Child Theme appeared first on RickRDuncan.com. It was published on and was last updated .