Website Building » WooCommerce » How Do I Create a Template in WooCommerce?

How Do I Create a Template in WooCommerce?

Last updated on January 12, 2023 @ 1:05 pm

Adding a new WooCommerce template is simple and straightforward. By default, WooCommerce comes with a few basic templates that can be used for different pages on your store.

If you want to add a new template, follow these steps:

1. Go to the WooCommerce tab in your WordPress dashboard.

2. Click on Templates.

3. On the next page, you will see all the available templates.

To add a new template, click on the Add New Template button.

4. On the next screen, you will be able to select the type of template you want to add. For this example, we will be adding a Single Product Page template.

5. Once you have selected the template type, you will be able to give your template a name and then click on the Create Template button.

6. On the next screen, you will be able to edit your template using the WordPress editor. Once you are happy with your template, click on the Publish button to make it live.

Creating a Custom WooCommerce Template

If you want to create a completely custom WooCommerce template, then you will need to create a new file in your theme’s folder. For this example, we will assume that you are using the WordPress default theme (Twenty Seventeen).

1. Go to your theme folder and create a new file called “single-product-custom.php”. You can do this using a text editor like Notepad++ or Sublime Text.

2. In this new file, you will need to add the following code:

.single-product {
   /* Your CSS code goes here */
} 

3. Save your changes and upload the file to your theme’s folder on your server.

4. You can now edit this CSS file to add your own custom styles.

5. Once you are happy with your changes, save the file and upload it to your server.

PRO TIP: If you are not familiar with WooCommerce, we recommend that you consult with a professional before attempting to create a template. Creating a template in WooCommerce can be complicated and may result in unexpected errors if not done correctly.
Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.