scarhand Posted April 6, 2010 Share Posted April 6, 2010 I want to use a conditional statement that adds a line break every 15 posts. Example: post 1 post 2 post 3 post 4 post 5 post 6 post 7 post 8 post 9 post 10 post 11 post 12 post 13 post 14 post 15 <br /> <- added via modulus or w/e post 16 post 17 post 18 post 19 post 20 post 21 post 22 post 23 post 24 post 25 post 26 post 27 post 28 post 29 post 30 <br /> <- added via modulus or w/e post 31 post 32 I've tried using: If ($postcount % 15) echo '<br />'; Maybe I'm not totally grasping the operator. Could someone tell me the proper way to accomplish this? Quote Link to comment Share on other sites More sharing options...
scarhand Posted April 6, 2010 Author Share Posted April 6, 2010 Is this correct?: If (($postcount % 15) == 0) echo '<br />'; Quote Link to comment Share on other sites More sharing options...
greatstar00 Posted April 6, 2010 Share Posted April 6, 2010 u should go about if(!($postcount%15)), because 0 actually is false, and !false = true 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.