I have a count (of wordpress posts)
if the count of posts equals 5, 9, 13, 17, 21 etc then I want to write some css
Any ideas how to check if the count is the above numbers without doing a switch statement- e.g. is there a way to tell that number sequence?
for example:-
if (($count == 1) {echo " no-margin-left";}
if (($count % 4) == 0) {echo " no-margin-right ";}
and then I want
if count equals 5, 9, 13, 17, 21, etc etc etc then echo " clear-left no-margin-left ";
thanks in advance
andy
if count == 5, 9, 13, 17, 21 etc etc echo....
Moderator: General Moderators
Re: if count == 5, 9, 13, 17, 21 etc etc echo....
(($count - 1) % 4 == 0) maybe?