What if you wore the same coloured pants and shirt everyday. A same colour 24X7 for the next 365 days. You will surely reach a point where you will be frustrated with yourself. The same happens with blogs. Many WP-newbies just apply a theme and leave it to rest in peace. NO! If you want your blogging career to be successful you ought to get your hands dirty! Wondering how to edit a theme in WordPress? Leave it to us
To begin with, WordPress offers various facilities to make your site look cooler, smarter. Don’t you wish your site was cooler? Who doesn’t? This post teaches you how.
What can you edit in a theme?
You can edit the following
- Change your site title and tag name
- Change your site logo
- Edit your headers and footers. Check out this post to know more about it
- Edit menus
- Change the colours of your headers
- Add widgets and much more…
How to edit theme in WordPress?
To begin with, There are six different ways with which you can modify a theme in WordPress. They are,
- Using theme optimizer
- Locally installing WordPress
- Theme edits(which has no further updates)
- Creating a child theme
- Forking a theme
- Writing a plugin
As this post is aimed at helping newbies who might not have the prerequisite knowledge to code, methods 1 to 4 has been elaborated in this post which
A Fore-note: Editing theme via WordPress editor
DO NOT edit themes directly via the theme editor as the changes made cannot be recovered and even the removal of a small semi-colon or a comma causes the site to crash. It is generally advised to follow other methods (like the ones mentioned below) to edit themes via the WordPress editor
1. The Theme optimizer
The theme optimizer is one of the most easiest ways to edit your theme in wordpress. To access the theme optimizer,
Firstly, log on to your dashboard, navigate to Appearance> Customize which will directly take you to the customizer window. In the customizer window you are provided with a variety of options where you can edit the background ,text color, header background colour etc…
- To do so click on the “Colors” option which provides you with a list of options which allows you to change the pre existing colors to your desired ones.
2. Then, Click on “Select color” to the corresponding option which you wish to edit. After making all the change and click Publish to make the changes go live.
Edit WordPress themes using Additional CSS:
The following example shows you how to edit theme in wordpress using Additional CSS. It is nothing but a column which allows you to add new pieces of CSS codes which would be helpful for incorporation of new features.
- Firstly, let us consider,
youwish to change the WordPress header name colour. To do so, right click on the header and click on inspect. It opens an inspector window in the bottom.
2. Now towards the right, you can find an option called styles where you can find color. Just click on the color and give a color of your choice. After specifying the color code hit enter. The changes would appear live on the site. This does not impact your theme and the change can only be viewed by you.
Note: The color can be mentioned in the form of a name or by providing the color code.
3. To make the changes global, copy the entire part of the code. In the customizer window you can find an option called “Additional CSS” in the bottom. Click on it and paste the copied code in it.
4. Finally hit “Publish” . This would consequently make your changes public. As shown below.
You can do this for other interactive elements too.
PROS: Easiest method to edit in a professional way
CONS: Certain non-interactive elements of the site cannot be edited.
2. Installing wordpress locally and edit themes
To begin with, WordPress can be installed locally and changes can be made to it. This one of the methods even advanced developers use to test their own themes and plugins. It is pretty simple.
How is this different and safe as compared to other methods?
It is because changes made to this site will not affect the live server and you can even make changes to the local wordpress theme editor. If your site crashes do not worry all you have to do is to create a new database and reinstall wordpress locally.
To know more about installing WordPress locally check out this post.
PROS: Provides a lot more tools for editing and messing with your site without causing any crashes\
CONS: Must know how to install WordPress locally. That’s it. Not a big issue though.
Make sure that the theme will not get any updates in the future. Else the changes made to the theme will be reverted when the theme is updated.
In case you are using themes like Genesis, Elegant themes etc… Skip to the next step. This method is similar to that of the first one. Before proceeding make sure you have a backup of your site. DO NOT edit any other files, as incorrect changes may bring down your site. To edit your WordPress theme
- Firstly, log on to your FTP and select the file public_html/wp-content/themes/_name_of_theme via the file manager in your FTP client.
- Then, choose the style.css file. Here you can drop in the code from section 1 and make sure to remove the CSS from the customizer if you have added any. Add the changes to the end of the file
PROS: Easy implementation
CONS: Can only be implemented with themes which receive no further updates
4. Creating a Child theme
The next method to modify wordpress themes is by creating a child theme. Imagine child theme as a sort of 3d glasses. It acts as a additional layer which resides on the top of a parent theme. It inherits all the functionalities from that of the parent theme.
- To edit your WordPress theme, log on to the Cpanel of your website. Type in your username, password and finally click “Log in”.
2. After logging into the cpanel click on File manager.
3. Then, Click on the file named public.html or go to your WordPress installation directory and navigate to wp-content->themes.
4. Select the create new folder icon to create a new folder. Enter your child theme’s name and hit create.
5. Now open the folder which you have recently created and hit the New File button. It will request you for a file name. Enter style.css and hit Create.
6. Paste the following code.
7. Make sure to change all the values match with your site and themes. Give your theme a name and finally hit save.
8. Create a functions.php file in the same folder. You can either add new funtions to the php file or create a blank file, but do not copy the code from the functions.php file of the parent as it needs to remain seperate.
9. Now log on to your Admin Dashboard. Go to Appearance->Themes. You can find the newly created theme and click Activate. Now view your site. You can find some issues with your site. Do not fear. This is caused due to an incomplete or a blank functions.php file.
10. To get the code from functions.php file. Navigate to Appearance-> Editor.
11. WordPress has a function to load CSS from the parent files. Copy the following code and paste it in your functions.php file
12. Hit Update once you have made all the changes. Now visit the site where you could notice that the site theme looks exactly like that of the parent theme.
Pros and Cons:-
PROS: Proved to be one of the most safest methods of messing with your themes online.
CONS: Sometimes the process of creating a child theme becomes a tedious one.
You have created a child theme successfully.
What content will you lose if you change wp themes?
All your customizations vanish if a new update pops up. Check out this post to know how to update a theme without losing customization.
How to upload themes and activate them?
What if you have developed your own themes or downloaded a few online ones. How will you upload them? It is a pretty simple process.
- To begin with, log on to the Admin dashboard. Navigate to Appearance>Customize.
2. In the top, you can find a button called “Add new” click on it. In the next page click on the Upload theme option which is located in the same location as that of the previous one.
3. Now choose the theme file from the local directory and click on Install Now to install the theme.
4. Once you have installed the theme click on Activate to activate it. You can preview your uploaded theme live on your site.
This is how you can edit a theme in WordPress
Frequently Asked Questions
Do not worry. You can use your FTP Client or CPanel to get you site back. Click here to know more.
Yes, you can do so by using the theme customizer.
Hope you have learned how to edit a theme in WordPress. If you have any queries leave them in the comment section below I will reply to them ASAP. Au revoir!