Two layouts in posts element

Hi there,

is it possible to have multiple or at least two different layouts in the posts element based on the posts category?
I’m using a posts (minimal) element to include related posts at the end of a blog post.
That’s working so far but I need two different layouts in those related posts based on the posts category.

Posts of category A should appear different in related posts than posts of category B.
Is there a way to do that using your elements or is this the wrong approach? Would be happy if you could point me in the right direction.

Kind Regards

Hi @ArtOfSpring,

Thanks for reaching out!

Yes, it is possible to have a different layout but not using the posts(minimal elements). You need to use the loopers functionality. You can check this thread.

Hope that helps.

Thank you

Hi there,

thanks for getting back to me.
So this is another way of setting up a related posts element but I still don’t understand how to have two different layouts for the posts teaser in related posts.

Let’s say you are viewing a post of category A. At the end of the post you have the related posts element.
It consists of 3 related posts. All are category A but one of them is also sub-category or tag B. This one should have a slightly different layout than the other two.

Hello @ArtOfSpring,

With the help of the element conditions, you can always do what you have in mind. If you may, please create a mock layout or at least a screenshot of the related post element that you want to display. Also, add the slight difference that you want in a different two so that we can have a clear idea of what could be the structure be like to make it possible.

Best Regards.

Sure I just created a mock layout in a post (draft) please find the related posts at the end of the page. It’s inside a global block element. The second post of the three has a different layout.

Hi @ArtOfSpring,

Thanks for providing all the details but it seems that the given credential is not a super admin because I can’t access other settings in the Pro. I suggest that you add all the privilege to this user account.

Hope that helps.

Thank you.

Hi there,

you can change the preferences as you like (acitvate advanced mode and dynamic content).
It’s the super admin account, some things are just turned off by default in the pro settings.

Hi @ArtOfSpring,

You need to set up a Multiple Looper Consumers, this means that on the Looper Consumer’s item option, you need to set only one (first post), then add another column (or duplicate the first one) and edit it to have a different design, that 2nd column should be set to consume one post also (the second post), then do the same for the 3rd column.

This tutorial will give you a better idea Loopers: Using Multiple Consumers

Hope that helps,

Hi there,

this solution kind of works but has its limitations/weak spots.

The post with the different layout is always at a fixed position.
It should work more dynamically to achieve something like related posts.

If the looper provider is set to the currently viewed posts category (limited to 3) and 2 of the latest 3 posts have a certain sub category, they should have a specific design. If only 1 of the latest 3 has the certain sub category, it should be the only one with a specific design.

It should work the same way like in the standard wordpress archives where different post types will also appear different in the archive (e.g galery, video etc.).

Hello @ArtOfSpring,

Please keep in mind that the Single Layout and the Archive layout should not have a Looper Provider so that it will display the post item dynamically. You only add another Looper provider if you want to display recent posts or want to display other post items when viewing the Single Layout or Archive Layouts such as display recent posts in a sidebar or footer area of the single layout or archive layout.

Take for example, your “Archive” layout that is assigned for the FortNite post category.

The Looper Provider is not necessary because the archive itself runs a WordPress loop. The same with the single layout. You do not need to have Looper Provider just to display the title or post content of the current post.

Hope this makes sense.