Some of you are aware that I LOVE Divi Theme from Elegant Themes but one of the things that has been frustrating me is not being able to personalise the archive pages on my Woocommerce product category pages. Well I solved it with no plugins pieced together from bits all over the web. So how did I do it?
Here is the step by step tutorial on the video as I show you all the steps:
So what were they again? and what were the magic bits I pasted in?
Here is the quick reference guide:
- Create Your Layout
- In your WordPress dashboard go to Divi > Divi Library
- Add a new layout
- Set this layout to Global (you have to do this when making it as it is not changable to global later)
- Save layout
- Copy Woocommerce template files to your theme
- in wp-content > plugins > woocommerce > templates
- copy these to your theme (highly recommend using a child theme for this) in a folder called “woocommerce” (CTRL drag in cpanel)
- Change template file names in your theme
- find your slug of your product category
- use the rename function to rename both of the files to add “-yourslug” before the .php
- So “archive-product.php” becomes “archive-product-yourslug.php”
- and “taxonomy-product_cat.php” becomes “taxonomy-product_cat-yourslug.php”
- Edit taxonomy-product_cat-yourslug.php
- Edit the code of this file and change the line “wc-get-template(‘archive-product.php’);”
- Change it to “wc-get-template(‘archive-product-yourslug.php’);”
- Save file
- Edit archive-product-yourslug.php
- Remove everything after “get_header( ‘shop’ );” all the way down to and leave in ” get_footer( ‘shop’ ); ?>”
- Between those 2 lines past in
- Change the XXXX to the layout number (found by looking in the URL when viewing the layout editor screen
- Save file
To update the layout you then just go back into Divi > Divi Library and make your changes!!
How does it get any easier than that?