-
Good day
With the recent update of my hosting platform to PHP v8 I had to go through and make sure everything on my site was up to date. The site has been using the Lifecoach theme for a few years now and after updating I am now running into an issue where woocommerce is now breaking the site
Fatal error: Uncaught Error: Call to undefined function create_function() in /usr/www/users/admin/wp-content/themes/lifecoach/functions.php:925 Stack trace: #0 /usr/www/users/admin/wp-settings.php(585): include() #1 /usr/www/users/admin/wp-config.php(92): require_once(‘/usr/www/users/…’) #2 /usr/www/users/admin/wp-load.php(50): require_once(‘/usr/www/users/…’) #3 /usr/www/users/admin/wp-admin/admin.php(34): require_once(‘/usr/www/users/…’) #4 /usr/www/users/admin/wp-admin/plugins.php(10): require_once(‘/usr/www/users/…’) #5 {main} thrown in /usr/www/users/admin/wp-content/themes/lifecoach/functions.php on line
When I tried to check the theme for which line that is referring to I found that it is related to this piece of code
/* WooCommerce products per page related
=============================================*/
add_filter( ‘loop_shop_per_page’, create_function( ‘$cols’, ‘return 12;’ ), 20 );
add_filter( ‘woocommerce_output_related_products_args’, ‘jk_related_products_args’ );
function jk_related_products_args( $args ) {
$args[‘posts_per_page’] = 3; // 4 related products
return $args;
}with the add_filter( ‘loop_shop_per_page’, create_function( ‘$cols’, ‘return 12;’ ), 20 ); being line 925
Can you please help me fix this
Hello and thanks for reaching us.
Andrea here from Themes2go Customer support.If you have the chance to login to your admin area, I suggest you to install a plugin called WP Rollback (https://wordpress.org/plugins/wp-rollback/) and install a previous version of Woocommerce while our team will update the theme.
If not, you can use an automatic backup from your cPanel and restore a previous copy of the website.
Just keep me posted if these work for you.
AndreaHello
I have tried downgrading Woocommerce on the site from 7.1 all the way down to version 5.3. Nothing has worked
Hello and thanks for updating us.
Did you try to use an automatic backup from your cPanel and restore a previous copy of the website?Once checked that is not working, we need to access to your website.
Please send us a message including:
– wp admin url
– admin username
– admin passwordOnce received we could check and get back to you.
IMPORTANT: make sure to perform a full backup of your website before sending your credentials.Best,
Andrea
You must be logged in to reply to this topic.