How to find files to edit in a WordPress theme


We often get asked how to find files to edit in a WordPress theme.

WordPress themes consist of several different files. Sometimes it can be difficult for beginners to figure out which files they should edit to make certain changes to a theme.

In this article, we will show you a simple and quick way to find out which files to edit in a WordPress theme.

Understanding WordPress Theme Template Files

WordPress themes consist of several files. These include template files, custom template tags and functions, template parts, images, JavaScript and CSS files.

Everything the best WordPress themes follow official best practices. This means they use a standard file and template structure to organize all of their code.

For example, all WordPress themes have archive.php, single.php, functions.php and other files.

Each of these files is used as a template to display a specific area of ​​your WordPress website. For example, single.php is used to display individual posts, and the page.php template is used to display a single page.

Understanding the WordPress template hierarchy gives you a better understanding of how WordPress works.

If you ever need to add code to your WordPress theme, this will also help you identify which files you may need to edit.

See our full for more details WordPress Template Hierarchy Cheat for beginners.

With that in mind, let’s see how to easily find files to edit in a WordPress theme.

Finding template files to edit in a WordPress theme

The first thing you need to do is to install and activate it What is a file to include. Check out our step-by-step guide for more details how to install a WordPress plugin.

The plugin works immediately after installation and there are no settings you need to configure.

After activation, you need to visit the front end of your website and you will notice the new “What The File” menu in WordPress admin prompt.

What does the file mean?

Now you need to hover your mouse over the menu item and a drop-down menu will appear with a list of template files used to display this page.

Clicking on a file name will open the default WordPress file editor where you can edit the specific file.

WordPress theme file editor

However, we do not recommend using the WordPress file editor to edit theme files because there is no undo option.

If you accidentally get locked out of your site, you’ll need to use an FTP client to fix it. Therefore, we recommend using a FTP client or the File Manager application in your WordPress hosting The Control Panel.

You can edit theme files with any regular text editor like Notepad.

It is also a bad idea to modify your WordPress theme directly. These changes will disappear when you update the theme.

If you’re just adding CSS, you can add it as Custom CSS in WordPress. For all other changes to your theme files, you should create a child theme.

The What The File plugin can help you find theme files that you need to copy and edit in a child theme.

Footnote: The menu item that the plugin adds to the admin bar will be visible to all logged in users and has a link to an external website. Use this plugin only in a development environment such as a venue.

We hope this article helped you find which files to edit in your WordPress theme.

You may also want to see ours WordPress Theme Development Cheat or take a look WordPress generates CSS classes which you can use to design your themes.

If you liked this article, please subscribe to ours YouTube channel for WordPress video tutorials. You can also find us at Twitter and Facebook.



Leave a Comment

error: Content is protected !!