Warning: Division by zero in
-
Updated the template to the latest version
I get an error Warning: Division by zero in /home/***/***/www/wp-content/themes/woodmart/inc/woocommerce.php on line 2756
The design also broke down in categories, possibly due to an error
This is a development site. I change the template from DIVI to Woodmart
Images for products and categories are not uploaded. The fact that you do not see them is normal 🙂
Hi,
Try to add the following PHP code snippet to the child theme functions.php file to fix this
function woodmart_get_widget_column_class( $sidebar_id = 'filters-area' ) {
global $_wp_sidebars_widgets;
if ( empty( $_wp_sidebars_widgets ) ) :
$_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() );
endif;
$sidebars_widgets_count = $_wp_sidebars_widgets;
if ( isset( $sidebars_widgets_count[ $sidebar_id ] ) || $sidebar_id == 'filters-area' ) {
$count = ( isset( $sidebars_widgets_count[ $sidebar_id ] ) ) ? count( $sidebars_widgets_count[ $sidebar_id ] ) : 0;
$widget_count = apply_filters( 'widgets_count_' . $sidebar_id, $count );
$widget_classes = 'widget-count-' . $widget_count;
$column = 4;
if ( $widget_count < 4 && $widget_count != 0 ) {
$column = $widget_count;
}
$widget_classes .= woodmart_get_grid_el_class( 0, $column, false, 12, 6, 6 );
return apply_filters( 'widget_class_' . $sidebar_id, $widget_classes);
}
}
Regards
Thank you. Everything works well
The topic ‘Warning: Division by zero in’ is closed to new replies.