I have a masonry section of my website where based on the number of items within the section each individual part will have a different width. Right now I am manually setting the width's of each item. Is there a better way I can do this?
if($postCount == 1){$width = array("1-1");}
if($postCount == 2){$width = array("2-3","1-3");}
if($postCount == 3){$width = array("1-3","1-3","1-3");}
if($postCount == 4){$width = array("2-3","1-3","2-3","1-3");}
if($postCount == 5){$width = array("2-3","1-3","1-3","1-3","1-3");}
if($postCount == 6){$width = array("1-3","1-3","1-3","1-3","1-3","1-
3");}
if($postCount == 7){$width = array("2-3","1-3","1-3","1-3","1-3","2-
3","1-3");}
if($postCount == 8){$width = array("2-3","1-3","1-3","1-3","1-3","1-3","1-3","1-3");}