WordPress.org

Ready to get started?Download WordPress

Forums

Warning: Division by zero (7 posts)

  1. miathyria
    Member
    Posted 8 years ago #

    For a year now, everything has run smoothly. I've gone through two upgrades without any major problems and suddenly, yesterday I start getting emails from my readers that they can't access the site.

    Warning: Division by zero in /home/shag/domains/thewebasylum.com/public_html/mia/wp-includes/template-functions-links.php on line 517

    I will include that originally, I still had 1.5.2 installed. I was hopping that the 2.0 upgrade might fix the problem. Instead, it just moved the error from line 478 to line 517.

    Anyone have an idea as to why this would suddenly become an issue?

  2. bobmorris60
    Member
    Posted 8 years ago #

    It's probably doing a division calculation and trying to divide by zero, and that will crash any computer on the planet (if it's not trapped.)

    About line 517 in 2.0 is "function posts_nav_link" which does indeed contain division. Looks like posts per page is zero. Anyone know why that could be happening?

    $max_num_pages = ceil($numposts / $posts_per_page);

  3. miathyria
    Member
    Posted 8 years ago #

    At the very least, is anyone more familiar with coding and can help me with what I could replace that line with (or can it be deleted all together)?

  4. What is your posts per page set to in your admin area?

  5. miathyria
    Member
    Posted 8 years ago #

    5

  6. Hmm, weird.

  7. miathyria
    Member
    Posted 8 years ago #

    Ah hah! I posted that from memory and then walked away to run an office errand. It occurred to me that I should check the Admin Option for that and make sure I didn't fib. Somehow, the option had been reset to zero (obviously the source of the error).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.