Skip to content
Advertisement

WordPress | Loop different col-md

I know the wordpress loop is done like this:

JavaScript

and I will have 4 posts with col-md-6

now I need something more, or rather I would like to create an automatic structure which, however, is composed in this way, how can I do?

JavaScript

that would give me this result: news magazine

how can i make this structure with the wordpress loop?

Advertisement

Answer

An option is to split the query like this:

JavaScript

Another option is to add a counter in your while loop, check where you are and act accordingly:

JavaScript

Not sure about the structure but this is the logic

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement