Cars Pro Theme – Installation failed with php 8.2

Home Support Theme Installation Guide Cars Pro Theme – Installation failed with php 8.2

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #52056
    Rico Leutritz
    Participant

    Hi Support Team,

    I have the cars-pro theme installed on my WordPress 6.2.2. In the last days, I updated my PHP from 7.4 to 8.2.7. Now the WordPress send a mail with following stack trace:

    An error of type E_ERROR was caused in line 630 of file #Domain#/wp-content/themes/cars-pro/functions.php. E: Uncaught Error message: Call to undefined function create_function() in #Domain#/wp-content/themes/cars-pro/functions.php:630
    Stack trace:
    #0 #Domain#/wp-settings.php(591): include()
    #1 #Domain#/wp-config.php(116): require_once(‘…’)
    #2 #Domain#/wp-load.php(50): require_once(‘…’)
    #3 #Domain#/wp-login.php(12): require(‘…’)
    #4 {main}
    thrown

    When I try to reinstall the theme, the error occurs again.

    Can you fix this problem? I will launch my website in the next days.

    Thanks in advance.
    BR Rico

    #52062
    FlyThemes
    Keymaster

    Hi

    Kindly switch back to 7.4 and send site URL and the login details to support@flythemes.net so we can just replace the function. Once we done it you can switch php to latest version and it will work.

    Thank You

    #52063
    Rico Leutritz
    Participant

    Hi,

    thanks for your reply. I found the error by myself and fix it. Since PHP 8.x the “create_function” was deprecated and no longer available. You use this in your funtions.php on line 630.

    add_filter( 'loop_shop_columns', create_function( '$columns','return 3;' ) );

    I replace the function like this:

    add_filter( 'loop_shop_columns', function($columns){return 3;} );

    For other users of your templates, I think it is good to change this to the new version. I find your templates amazing.

    BR Rico

    #52064
    FlyThemes
    Keymaster

    Hi

    Yes, That’s correct. We are updating.

    Thank You

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.