How to Enable Template Editing in Non Block Based Themes in WordPress

Do you want to enable template editing in non block based themes or classic themes in WordPress.

If yes then in the article we have shared the step by step process to do this easily.

Template editing was first introduced in WordPress 5.8 where it was disabled by default. However, it can be activated by adding a code snippet.

Support for template editor in WordPress 5.8
Support for template editing in WordPress 5.8

This feature was later on fully released in WordPress 5.9 update and it marked the introduction of new block themes and the site editor.

It is important to know that if you have installed a block based theme then template editing features comes activated as it supports then new site editor.

On the other hand if you are using a customizer based theme or a non block or classic theme then to activate the template editing feature you will have to add a code snippet or include theme.json.

We are not going to talk about theme.json in this tutorial as it is a separate topic on its own.

And keeping this in mind, in this tutorial we are going to share how can you easily enable template editing in non block themes.

How to enable template editing in non block based themes

Before we move forward, it is important to know that this article is just for informational purpose and we recommend you try this feature on a local site and not a live site.

Keeping this in mind below we have shared all the steps and you can navigate by clicking on links.

Login to WordPress admin (optional)

To enable template editing in non block based themes, the first step is to login to your WordPress dashboard and for this you will have to visit https://yoursite.com/wp-admin

On visiting the link above, it will take you to the login page where you will have to enter your credentials

Login to WordPress admin
Login to WordPress admin

Locate functions.php file

Once you have successfully logged in, the next step is to navigate to the theme file editor in the Appearance Menu.

Theme file editor option in WordPress
Theme file editor option in WordPress

Doing this will show you all the theme files and here you will have to find the functions.php file in the list.

functions.php in theme file editor
functions.php in theme file editor

Add the code for enabling template editing

On finding the functions.php file, the next step is to open it and scroll down to the very bottom.

functions.php file in wordpress
functions.php file in wordpress

Once you are at the bottom, you need to add the below mentioned code snippet at the very end and save the changes

add_theme_support( 'block-templates' );
Add code snippet in functions.php file to enable template editing in non block based themes
Add code snippet in functions.php file to enable template editing in non block based themes

Check if template editing is enabled in non block based theme

After you are done adding the code snippet, the next step is to Add a new post or edit an existing one and look for template editing tab in the sidebar under Post Settings.

Template tab in WordPress editor after enabling template editing
Template tab in WordPress editor after enabling template editing

If you have correctly followed the process then you will see a Template tab like the one above and it will allow you to create and edit templates in non block based themes.

Template editing option in WordPress editor
Template editing option in WordPress editor

And that’s it you have successfully added support for template editing in non block based themes.

Now before you leave, again, I would like to stress on the fact that this tutorial is only for informational purposes and we do not recommend enabling it on production / live sites.

Enable Template Editing in non block themes- Video

Enable Template Editing in non block themes- Video

Having said that,

I hope you will find this tutorial helpful and are able to easily enable template editing in non block based WordPress themes.

In case you have any queries feel free to get in touch.

To stay up to date with our content we recommend you subscribe to our YouTube channel and email list.

Also, don’t forget to join our Facebook group.

Leave a Reply

Your email address will not be published. Required fields are marked *