dnelsalty Posted March 13, 2010 Share Posted March 13, 2010 Here is the Link: http://dnelsalty.com/wordpress/wordpress/?page_id=6 Here is the Line containing Error: $pages = ceil($total_posts/$posts_per_page); Can someone please tell me what is wrong with this? Thanks! Quote Link to comment Share on other sites More sharing options...
Rustywolf Posted March 13, 2010 Share Posted March 13, 2010 It means that one of the variables has no value (aka 0) So id check that there isnt any errors gathering data Quote Link to comment Share on other sites More sharing options...
dnelsalty Posted March 13, 2010 Author Share Posted March 13, 2010 What do you mean? It is a brand new site. Considering the only variables I see there are based on post count... So if I make a post or get someone to make a post it should work fine? Or what? Quote Link to comment Share on other sites More sharing options...
trq Posted March 13, 2010 Share Posted March 13, 2010 0 cannot be divided by 0, its that simple. I would be taking a look at the code within pagination.php on line 13. Quote Link to comment Share on other sites More sharing options...
dnelsalty Posted March 13, 2010 Author Share Posted March 13, 2010 I did. Like is said... Here it is again $pages = ceil($total_posts/$posts_per_page); Quote Link to comment Share on other sites More sharing options...
trq Posted March 13, 2010 Share Posted March 13, 2010 You'll need to ensure that $posts_per_page is not zero. Quote Link to comment Share on other sites More sharing options...
dnelsalty Posted March 13, 2010 Author Share Posted March 13, 2010 Where can I find that and correct it? Quote Link to comment Share on other sites More sharing options...
trq Posted March 13, 2010 Share Posted March 13, 2010 I have no idea, but you could do it quite simply just prior to attempting to divide by it. if ($posts_per_page == 0) { $posts_per_page = 1; } $pages = ceil($total_posts/$posts_per_page); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.