Home Forums WoodMart support forum Division by zero

Division by zero

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #185261

    HasanAlhasan
    Participant

    Hello,
    The problem was within WordPress new version, I solved it.
    But now I have a new problem in lazy loading which is “Warning: Division by zero in /home/customer/www/rozanastore.com/public_html/wp-content/themes/woodmart/inc/modules/lazy-loading.php on line 335

    and here is a screenshot.
    Could you please help me in it
    Thanks.

    Attachments:
    You must be logged in to view attached files.
    #185298

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your FTP access so we can check it?

    Thank you in advance

    #185314

    HasanAlhasan
    Participant

    Hello,
    Could you fix it without disabling any plugins?
    If you can’t please take a copy of our website and check it.
    Here is FTP account for you
    Thanks

    #185363

    Artem Temos
    Keymaster

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

    function woodmart_get_placeholder_size( $x0, $y0 ) {
       if ( !$y0 ) {
          $y0 = $x0;
       }
       $x = $y = 10;
       if( $x0 < $y0) {
          $y = ($x * $y0) / $x0;
       }
       if( $x0 > $y0) {
          $x = ($y * $x0) / $y0;
       }
       $x = ceil( $x );
       $y = ceil( $y );
       return (int) $x . 'x' . (int) $y;
    }
Viewing 4 posts - 1 through 4 (of 4 total)