And I have created a news template, but I need to get the posts to display like my example where the first bootstrap row displays 3 posts then beneath that it displays 4 posts.
Is this possible, I cant seem to find the relevant information for me to achieve this.
Really hoping someone can point me in the right direction, on how I would code my template for this layout.
You should be able to achieve this layout with Flexbox.
Make the widths of your first 3 elements inside the post container calc(100% / 3). Make the other widths 25%. Allow your flexbox container to wrap flex items.
Thanks for your response, it is more the functionality I am after, to display posts like the layout I mentioned.
I already have this basic code below from me testing things out, but I need the ability to split the posts into two rows, one row with 3 columns and the other row with 4 columns, all displaying posts.
You could probably keep track of which post you’re on with a PHP variable. Increment that variable as the last operation of your loop. If you’re on one of the first 3 items, output the markup for your 3-column layout. If not, output the markup for your 4-column layout.
The examples in the codex that I looked at seem to focus on various query parameters to control various results.
I would be inclined to put together a child function, but there needs to be some way to have more control over this depending on conditions
In other words after the beginning of the while loop, and before its end, there needs to be an “if some condition, do this, else do this” or most likely less optimally, separate queries outside of the while.