• It is in the stairway theme, showing on all my pages.

    Warning: Division by zero in /home/oregons9/public_html/wp-includes/comment-template.php on line 1338

    Below is the code it is referencing:

    $comment_args[‘offset’] = ( ceil( $top_level_count / $per_page ) – 1 ) * $per_page;

    How do I fix?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author TT Themes

    (@tomastoman)

    Dear Rod Redpath,

    did you modify the theme in some way or are you using the original (unmodified) version please? What was the last thing you made before the problem has occured?

    Please try to deactivate all installed plugins to see whether it could help. If this works, re-activate the plugins one by one until you find the problematic plugin. If this does not help, please verify whether the problem occurs when you switch to the default theme.

    Best regards,
    Tomas Toman

    Theme Author TT Themes

    (@tomastoman)

    One more tip: please verify what is your number of comments per page set in “Settings > Discussion > Other comment settings > Break comments into pages with xx top level comments per page”. If the field is empty or set to “0”, it might cause the problem.

    Best regards,
    Tomas Toman

    Thread Starter Rod Redpath

    (@kelticvisuals)

    Modified how? I didn’t change any of the code at all if that is what you are meaning. I did do the deactivate and reactivate plug-ins and the problem still existed. I’ll try the setting the comments. Thank you Tomas

    Theme Author TT Themes

    (@tomastoman)

    For example whether you haven’t added or removed some code from “header.php”, “functions.php” or other template files. If the comments settings are set correctly, please check whether the problem persists if you switch to the default Twenty Sixteen theme. If so, I recommend you to re-upload all files and folders (except the wp-content folder, wp-config.php and root .htaccess files) from a fresh download of WordPress.

    Best regards,
    Tomas Toman

    Thread Starter Rod Redpath

    (@kelticvisuals)

    No mods were done. And it did do it with the default. I’ll try both the changing the comments selection and then also with a new installation as noted above. Thank you. I’ll keep you posted on it.

    cerice

    (@cerice)

    Hello,

    I hope you read this message.

    I have the same problem I have corrected.

    In the file: /wp-includes/comment-template.php

    I insert this code : if ($per_page==0) $per_page=50;
    before line 1311 : $comment_args['number'] = $per_page;.

    Put your maximum value instead of 50 if it does not suit you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warning Division by Zero’ is closed to new replies.