S
S
Shane Matte2016-03-10 11:21:41
PHP
Shane Matte, 2016-03-10 11:21:41

How to display 2 posts per block in wordpress?

Hello. Is it possible to display the posts in this order?

<block>
 <post 1>
 <post 2>
</block>

<block>
 <post 3>
 <post 4>
</block>

etc.
Every 2 posts should be wrapped in a parent block. How can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim E, 2016-03-10
@creativeworm

get_posts() to help, but then there will be 2 cycles. If you want to get by with one, then after the second post write a condition and if it is met, then put

</block>
<block>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question