Home Forums WoodMart support forum WordPress error email

WordPress error email

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #134624

    KOCHER
    Participant

    Hello,

    I have received an email from my WordPress site. It seems there is an error due to Woodmart Theme. Please find the error message in private content section.

    The website is still working but it is the second message I receive.
    Can you tell me if this is a Woodmart issue or if one of my data is responsable ?

    Best regards,
    Cathy

    #134667

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it? Also, describe us step by step how to reproduce the error.

    Thank you in advance

    #134928

    KOCHER
    Participant

    Hello,

    I can not tell you what is causing the problem because I only receive messages afterwards.
    The WordPress message told the error is on line 1133 in the function.php file (/home/ecoetnousn/www/wp-content/themes/woodmart/inc/integrations/woocommerce/functions.php. Message d’erreur : Uncaught DivisionByZeroError: Modulo by zero in /home/ecoetnousn/www/wp-content/themes/woodmart/inc/integrations/woocommerce/functions.php:1133)

    In this file I have the below line, please see the link :
    https://snag.gy/pqGdIu.jpg

    Best regards,
    Cathy

    #134937

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php

      function woodmart_get_grid_el_class( $loop = 0, $columns = 4, $different_sizes = false, $xs_size = false, $sm_size = 4, $lg_size = 3, $md_size = false ) {
            $classes = '';
            $items_wide = woodmart_get_wide_items_array( $different_sizes );
            if ( ! $xs_size ) {
                $xs_size = apply_filters( 'woodmart_grid_xs_default', 6 );
            }
            if ( $columns > 0 ) {
                $lg_size = 12 / $columns;
            }
            if ( ! $md_size ) {
                $md_size = $lg_size;
            }
            if ( $columns > 4 ) {
                $md_size = 3;
            }
            if ( $columns <= 3 ) {
                if ( $columns == 1 ) {
                    $sm_size = 12;
                    $xs_size = 12;
                } else {
                    $sm_size = 6;
                }
            }       
            // every third element make 2 times larger (for isotope grid)
            if ( $different_sizes && ( in_array( $loop, $items_wide ) ) ) { 
                $lg_size *= 2;
                $md_size *= 2;
            }
            if ( in_array( $columns, array( 5, 7, 8, 9, 10, 11 ) ) ) {
                $lg_size = str_replace( '.', '_', round( 100 / $columns, 1 ) );
                if ( ! strpos( $lg_size, '_' ) ) {
                    $lg_size = $lg_size . '_0';
                }
            }
            $classes .= ' col-' . $xs_size . ' col-sm-' . $sm_size . ' col-md-' . $md_size . ' col-lg-' . $lg_size;
            if ( $loop > 0 && $columns > 0 ) {
                if ( 0 == ( $loop - 1 ) % $columns || 1 == $columns ) {
                    $classes .= ' first ';
                }
                if ( 0 == $loop % $columns ) {
                    $classes .= ' last ';
                }
            }
            return $classes;
        }
    #134946

    KOCHER
    Participant

    Hi,

    It’s done. I’ll come back to you in case the error appears again.
    Thanks.

    Cathy

Viewing 5 posts - 1 through 5 (of 5 total)