Home Forums WoodMart support forum Internal server error on load more button Reply To: Internal server error on load more button

#436958

metuza
Participant

I also did find an error in my log:
[21-Jan-2023 22:25:18 UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /public/wp-content/themes/woodmart/inc/functions.php:108
Stack trace:
#0 /public/wp-includes/class-wp-hook.php(308): woodmart_get_blog_shortcode_ajax(”)
#1 /public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)
#2 /public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /public/wp-admin/admin-ajax.php(188): do_action(‘wp_ajax_woodmar…’)
#4 {main}
thrown in /public/wp-content/themes/woodmart/inc/functions.php on line 108

A typical PHP8 issue so i updated code as below to fix problem for now:
if ( ! is_numeric( $atts[‘offset’] ) ) $atts[‘offset’] = 0;
for( $i = 1; $i < $paged; $i++ ){
$atts[‘offset’] += (int)$atts[‘items_per_page’];
}

Brgds
Rune