Despite how good your WordPress site may look and function, you’ll still feel the need to make changes to your website theme. In order to tweak anything in your theme, you’ll need to edit the PHP files.

Wondering how?

WordPress comes with a built-in editor – The Theme Editor – that allows editing all the files from within your site’s admin menu when accessed in a browser online. Or else, you can edit your WordPress files and save them on your local system, and later upload them to the site via an FTP client.

In this post, we’ll discuss the process of editing the files and ultimately your theme with admin menu.

But Before You Start

To edit your files and website theme accurately, there are few important considerations worth considering:

 

1. Don’t Forget to Create a Backup

Often making even minor changes to your site’s core files can result in breaking the website. And so, it is highly recommended that you must create a backup of your site, including all your files. Doing so, will help you restore your site back to its original form if its damaged during the process of editing your WP theme.

2. Familiarize Yourself With File Permissions

Every WordPress file contains a set of permissions that enables a user to read or edit a file. So, there’s a possibility that the file you wish to edit isn’t writable. Thus, before you initiate the task of making edits to your WordPress site’s PHP files, you must become familiar with “File Permissions”.

You can make changes to the file permissions using FileZilla or any other FTP client. And then,

Open up the cPanel of your FTP client, and navigate to Files → File Manager. Simply press the “Go” button provided at the button of the page as soon as the “Directory Selection” pop-up becomes visible.

From the pop-up box, you just need to change the numeric value in the textbox as shown in the image below:


Edit WordPress PHP Files

3. Edit Files Utilizing a Text Editor

As you may know, WYSIWYG editors generate messy code that is difficult to read. But, using text editors help in writing and editing plain text with no need for formatting. When searching for a text editor avoid using a Word Processing Program as it adds unwanted code or other changes that can break a file.

Fortunately, there are plenty of great text editors over the web that not only helps in making edits to files outside the WordPress editor, but also provides syntax highlighting, auto-completion, and other features.

    Editing WordPresss PHP Files and Theme

When it comes to editing WordPress PHP files to modify your theme, you can make changes to each file from within your browser using any one of the two WordPress built-in editors, namely: Theme Editor and Plugin Editor.

Since we need to make alterations to the theme, we need to learn about using the Theme Editor.
The Theme editor is nothing more than a text editor. You can access the text editor, by moving to Appearance → Editor menu from your site’s admin dashboard. Here’s a screenshot of how the WordPress editor menu of the Twenty Fourteen theme looks like:

WP Theme Edit
Fig. Twenty Fourteen Theme Editor Screen

In the image above, a list of PHP files of the currently active theme is displayed on the right-hand side of the editor screen. You can open any file you need to edit, and the content of that file will be displayed on the editor screen.

Some Important Considerations

• There is an “Update File” button available in the above image. This might not be present in all the servers if the file is not writable. However, it is crucial for making any changes to your WP files. So, you will have to change the file permission to enable the Update File option in your theme.

• Just above the list of all WordPress files in Twenty Fourteen theme, you can see a drop down menu which gives users the ability to switch among the installed themes (both active and inactive themes). Some users usually become confused presuming that selecting some other theme from the drop down menu will activate that theme. But that’s a wrong notion.

It merely opens up the files of that theme in the editor – that you wish to edit.

Remember, to activate the theme you need to hit the activate option by navigating to Appearance → Themes.

 

Functions.php file: Help Make Changes to the WordPress Theme

To implement changes in your WordPress site’s theme, you’ll most likely have to make edits in the functions.php file. But remember, in case you don’t know how to code, it is better that you should avoid using the Theme Editor for making edits to the functions.php.

That’s because users often edit functions file simply by pasting any code available online. But, pasting the code in an inaccurate manner can get you locked out of your website.

So, it is better to understand the FTP client before you start making edits to the theme’s functions file. Also, you must study tutorials that can help you learn about the commonly syntax errors to avoid when pasting the code.

A much better alternative is to seek professional assistance (ideally services of a WordPress developer) having enough experience in handling web development projects.

In Conclusion

This is just a beginner’s tutorial that will help novice WordPress users understand how they can modify their website theme, which requires making edits to WordPress files.

Remember, it is pretty easy to make tweaks to the theme. Just pasting code found over the web can help assist you in performing the necessary alterations. But you need to stay careful when making any changes to the core files in WordPress or it might break the site.

Thus, it is advised you should consider using a child theme for making the changes. Once you’re satisfied with the changes, you can implement them in your parent (primary) WP theme.

SHARE
Previous articleBest SEO Practices To Rank Your Website Higher
Next articleBest front-end frameworks collection for developer

Abdullah Al Mahamud is a programmer and founder of Thedevline an Inspiration blog since 2014. live in Bangladesh. He is passionate about Technology and Design. He works on the freelancing marketplace as a freelancer and has also written for Useful Article in this blog

Leave a Reply

avatar
  Subscribe  
Notify of