Creating a Column Based WP Post Loop

Question

Modifying the index.php file to display posts, I need a split the loop into two columns. Creating the HTML with inline CSS is easy and done, but I do not know nor do I understand how to create the argument for "post 1-4 to the left, post 5-8 to the right".

HTML code:

<div style="width:40%;padding:0 10px 0 0;float:left;">
1-4, 9-12 etc based on pagination
</div>

<div style="width:40%;padding:0 10px 0 0;float:right;">
5-8, 13-16 etc based on pagination
</div>
<div style="clear:both;"></div>

If someone can help me understand and help me make this, I would be very grateful.

0
Sofia Herrmann 4 months 2020-12-24T03:10:57-05:00 0 Answers 5 views 0

Leave an answer

Browse
Browse