WordPress Tutorial

What is a WordPress Theme Editor

Let’s say you found a perfect theme for your website. But once activated, you want to make changes to it. How can you do that? WordPress Theme Editor is the answer, as the name suggests.

To access the WordPress theme editor, go to Appearance -> Editor. It will generally look like this:

wordpress theme editor interface

On the right side is the list of the files you can edit – called template files. You can select other themes to modify by selecting the drop-down menu on the top left.

dropdown menu for selecting themes

Selecting another theme in the editor won’t activate it. You will only gain access to modify the theme – your current theme will remain unaffected.

If you want to change your theme, you should head to Appearance -> Theme instead.

All the theme files are written in PHP, CSS, JS, and JSON. Make sure you don’t mix it up with HTML.

WordPress themes create HTML pages. At the same time, WordPress stores the data shown on your pages in a database. Then, WordPress uses PHP to enable communication between the two. Therefore, editing the codes allows you to modify the chosen theme.

You have to choose the right file as well. If you want to modify your header, for example, you should choose header.php. Same goes if you want to manage your comment section, you should head to comments.php. For website styling, in particular, you will have to choose stylesheet.css.

Before editing your theme with the WordPress theme editor, we recommend you to create a child theme. WordPress child theme is a ‘duplicate’ that inherits the style and features of the parent theme.

By editing your child theme, you can apply any changes you want without affecting the original files. Going back to your default settings is also easy, as you just need to switch to your parent theme.

How to make changes to your theme? Here’s an example of adding a customized text on your admin panel’s footer.

  1. Access the WordPress theme editor by going to Appearance -> Editor.
  2. Activate your child theme in the drop-down menu and select function.php.
  3. Copy this line of code to your editor.
    /**
    * code #16 - customize the admin page footer text
    * source   - http://wordpress.stackexchange.com/a/6005/8922
    */
    function custom_admin_footer() {
     echo 'add your custom footer text and html here';
    } 
    add_filter('admin_footer_text', 'custom_admin_footer');

    In this case, the theme’s name is twentyseventeen.

  4. Change the section that says “add your custom text and HTML here” with your own sentence. Here’s the example:
    /**
    * code #16 - customize the admin page footer text
    * source   - http://wordpress.stackexchange.com/a/6005/8922
    */
    function custom_admin_footer() {
     echo 'Don’t change anything without my permission!';
    } 
    add_filter('admin_footer_text', 'custom_admin_footer');
    
    
  5. Click on the Update File below the editor.
  6. Open another menu within your Dashboard and scroll down to your footer. You will see the sentence there.output of theme modification

 

Ideally, you have to understand coding. However, there are a lot of cheat sheets that you can find on the internet, allowing you to instantly copy and paste it to your WordPress theme editor.

Regardless of how easy it is to use cheat sheets, we don’t recommend you to modify your theme if you don’t know how to code. Pasting the code incorrectly may result in you getting locked out from your site, or messing up the codes altogether.

One exception though, you can play around a bit and modify your CSS with WP Customizer. It’s easy and won’t affect your theme’s files. A lot of cheat sheets are also available.

For pro users, you can use plugins like Advanced Code Editor and WPide to ease the editing process. If you run a website with a lot of users, make sure you lock the editor menu. Otherwise, they might change the settings without your permission.

About the author

Herawan Dwika P.

A Psychology and Marketing graduate, Dwika possesses a solid mix of empathy and good eyes for opportunities that lead him towards earning years of experience with WordPress, Linux, and Hosting. When he's not sharing his knowledge with others, Dwika works on his social platform, promoting humanity through the web. He's also a movie enthusiast. He takes them very, very seriously.

Add Comment

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get Exclusive Content

Join thousands of webmasters who get our free newsletter with tips on how to drive more traffic and revenue to their websites!

Please wait...

Thank you for sign up!