Is there a way to return different number of posts per row in grid layout based on the post size retrieved from a custom field?
| Large post | | Medium post | Medium post | | Small post | Small post | Small post | | Medium post | Medium post | | Large post |
Rows order can be different. I get the post size value from the custom fields.
I believe the logics is as follows:
- get the size of a post
- if it fits the row fully, close the row tag, open a new row tag and check the next post
- if the post doesnt fit the entire row, get the next post size and check if it fits
Any practical ideas?
Thanks a lot.
Read more here: Different number of posts per row in grid layout