• Several URLs were giving 5xx server errors. I contacted my host provider. They found out my theme version Rife Free Version: 2.4.21 conflicts with their current PHP version 8.2. My WordPress version is 6.7.1. Below are my host’s server errors:

    [30-Jan-2025 21:31:17 UTC] PHP Fatal error:  Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in /home/customer/www/nycmoments.nyc/public_html/wp-content/themes/rife-free/advance/utilities/woocommerce.php:356
    Stack trace:
    #0 /home/customer/www/nycmoments.nyc/public_html/wp-includes/class-wp-hook.php(324): apollo13framework_wc_loop_single_product_categories('')
    #1 /home/customer/www/nycmoments.nyc/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #2 /home/customer/www/nycmoments.nyc/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #3 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/templates/content-product.php(42): do_action('woocommerce_bef...')
    #4 /home/customer/www/nycmoments.nyc/public_html/wp-includes/template.php(812): require('/home/customer/...')
    #5 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template('/home/customer/...', false)
    #6 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/templates/single-product/up-sells.php(42): wc_get_template_part('content', 'product')
    #7 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/customer/...')
    #8 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(2283): wc_get_template('single-product/...', Array)
    #9 /home/customer/www/nycmoments.nyc/public_html/wp-includes/class-wp-hook.php(324): woocommerce_upsell_display(0)
    #10 /home/customer/www/nycmoments.nyc/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #11 /home/customer/www/nycmoments.nyc/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #12 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/templates/content-single-product.php(72): do_action('woocommerce_aft...')
    #13 /home/customer/www/nycmoments.nyc/public_html/wp-includes/template.php(812): require('/home/customer/...')
    #14 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template('/home/customer/...', false)
    #15 /home/customer/www/nycmoments.nyc/public_html/wp-content/plugins/woocommerce/templates/single-product.php(37): wc_get_template_part('content', 'single-product')
    #16 /home/customer/www/nycmoments.nyc/public_html/wp-includes/template-loader.php(106): include('/home/customer/...')
    #17 /home/customer/www/nycmoments.nyc/public_html/wp-blog-header.php(19): require_once('/home/customer/...')
    #18 /home/customer/www/nycmoments.nyc/public_html/index.php(17): require('/home/customer/...')
    #19 {main}
    thrown in /home/customer/www/nycmoments.nyc/public_html/wp-content/themes/rife-free/advance/utilities/woocommerce.php on line 356

    At this point my server is running PHP 7.4 (outdated) My host provider recommends to be on PHP 8.2. Are you going to make your theme compatible with the latest PHP versions.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Theme Author apollo13themes

    (@apollo13themes)

    Hi, this will be fixed soon – for now, if you are using a child theme – add this code to the functions.php in child theme:

    function apollo13framework_wc_loop_single_product_categories() {
    global $product;

    //categories
    $terms = get_the_terms( apollo13framework_wc_get_product_id($product), 'product_cat' );
    if(!is_array($terms)){
    return;
    }
    if( sizeof( $terms ) ){
    echo '<span class="posted_in">';

    $temp = 1;
    foreach ( $terms as $term ) {
    if($temp > 1){
    echo '<span class="sep">/</span>';
    }
    echo esc_html($term->name);
    $temp++;
    }

    echo '</span>';
    }
    }
    Thread Starter Cocotu

    (@realcocotu)

    Hello,

    That did not work for my site. After creating the functions.php for my child theme I see the code being displayed at the top of every page in the website. Items from my shop do not show in the cart.

    Where can i send you screenshots? Thanks.

    Theme Author apollo13themes

    (@apollo13themes)

    Probably some sneaky bug in your functions.php file.

    Please send the screenshots by using https://snipboard.io/

    Thread Starter Cocotu

    (@realcocotu)

    Thread Starter Cocotu

    (@realcocotu)

    Can you share the proper way to create a child theme for your theme? Thanks.

    Theme Author apollo13themes

    (@apollo13themes)

    Thread Starter Cocotu

    (@realcocotu)

    Yes, I followed those steps to create the child theme and still got that error in the screenshot above. What else do you suggest? When is your fix going to be available?

    Theme Author apollo13themes

    (@apollo13themes)

    well, there must be a php error in the file you modified.

    can you paste here the entire functions.php file from child theme?

    Thread Starter Cocotu

    (@realcocotu)

    My functions.php:

    function apollo13framework_wc_loop_single_product_categories() {

    global $product;

    //categories

    $terms = get_the_terms( apollo13framework_wc_get_product_id($product), 'product_cat' );

    if(!is_array($terms)){

    return;

    }

    if( sizeof( $terms ) ){

    echo '<span class="posted_in">';

    $temp = 1;

    foreach ( $terms as $term ) {

    if($temp > 1){

    echo '<span class="sep">/</span>';

    }

    echo esc_html($term->name);

    $temp++;

    }

    echo '</span>';

    }

    }
    Theme Author apollo13themes

    (@apollo13themes)

    <?php

    /**
    * make sure child theme style.css will be loaded as last file before user.css
    */
    function a13_child_style(){
    global $wp_styles;

    //get current user.css dependencies
    $user_css_deps = $wp_styles->registered['a13-user-css']->deps;

    //register child theme style.css and add it with dependencies for user.css, to be sure it will be loaded after all other style files
    //it is useful for doing easier style overwrites
    wp_register_style('child-style', get_stylesheet_directory_uri(). '/style.css', $user_css_deps, A13FRAMEWORK_THEME_VER);

    //add child theme style.css as also needed for user.css
    array_push($wp_styles->registered['a13-user-css']->deps, 'child-style');
    }
    //register it later then parent theme styles
    add_action('wp_enqueue_scripts', 'a13_child_style', 27);

    /*
    * Add here your functions below, and overwrite native theme functions
    */

    function apollo13framework_wc_loop_single_product_categories() {
    global $product;

    //categories
    $terms = get_the_terms( apollo13framework_wc_get_product_id($product), 'product_cat' );
    if(!is_array($terms)){
    return;
    }
    if( sizeof( $terms ) ){
    echo '<span class="posted_in">';

    $temp = 1;
    foreach ( $terms as $term ) {
    if($temp > 1){
    echo '<span class="sep">/</span>';
    }
    echo esc_html($term->name);
    $temp++;
    }

    echo '</span>';
    }
    }

    You have no php opening tag and the file is not complete, is does not load parent assets. Please try the code I pasted

    Thread Starter Cocotu

    (@realcocotu)

    Thanks. If the code you pasted works, can I change back to the latest PHP version?

    Theme Author apollo13themes

    (@apollo13themes)

    give a try

    Thread Starter Cocotu

    (@realcocotu)

    It works now. I also tested with PHP 8.4.3. Should we keep this child theme even when you release the next update?

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