Converting my old wordpress theme template to php 8.2 or above

Associate
Joined
29 Sep 2010
Posts
2,270
Location
Cumbria
I have used a template for years which I have hacked to bits to suit what I needed it for. When trying to upgrade to 8.2 it breaks to critical error. I have used it on multiple sites and I have to do them all.

I have been trying to find something similar to build from but they all seem the be designed for using poxy page builders, scss or both.

I have been trying to find somewhere online that may be able to convert the code used as a template for my current sites so that I can rebuild them all the same way. I only want the basic site done and the rest I will hand code again for any changes I need.

Can anyone think of somewhere where I could upload the files form my template to make them compliant from 7.4.

If not, can anyone recommend a simple template that is not reliant on scss or page builders. Needs to be woocommerce compatible too.

Thanks.
 
Last edited:
You could find out the cause of the errors with your current template.

Annoyingly the errors aren’t always written to the server error logs. So here’s what I do if I can access the server files.

Edit wp-config.php

Add the following “define” code snippets (making sure to temporarily comment out duplicates that might be in the config file):

define( 'WP_DEBUG', true );

define( 'WP_DEBUG_DISPLAY', true );

define( 'WP_DEBUG_LOG', true );

define( 'SCRIPT_DEBUG', true );

This will write errors to a log file, weirdly in the wp-content folder.

Make your changes (e.g. switch to PHP 8.2), try to access the site, then read the resulting log file.
 
Last edited:
You could find out the cause of the errors with your current template.

Annoyingly the errors aren’t always written to the server error logs. So here’s what I do if I can access the server files.

Edit wp-config.php

Add the following “define” code snippets (making sure to temporarily comment out duplicates that might be in the config file):

define( 'WP_DEBUG', true );

define( 'WP_DEBUG_DISPLAY', true );

define( 'WP_DEBUG_LOG', true );

define( 'SCRIPT_DEBUG', true );

This will write errors to a log file, weirdly in the wp-content folder.

Make your changes (e.g. switch to PHP 8.2), try to access the site, then read the resulting log file.
Thanks. Will have a look.

I messed about with chat gpt last night just to see and it said to upload the files and it would try and convert all files. It did and then I used the zip on a test website and I saw a couple of errors were scripts in function file I had added ages ago. Got rid of them to see and it actually worked. Nowhere near like usual, but its not not critical error. I am going to plough through it all on a test site and see what breaks it.

I will do as you suggested though to see if any of those errors are likely to exist in the 8.3 version from ChatGPT

I hate AI but it would be very handy if its broke the back of it for me.
 
Last edited:
It seems the AI changes doesn't like the back end. When adding or amending a post it updates but the screen goes blank, does not go back to the editor.
 
Is there anything in the browser console when you do that?

Perhaps revert to your original template (without the AI changes), enable the log debugging I mentioned earlier and check the log file for errors.
 
Back
Top Bottom