I am making a view which includes multiple post types, I would like to have it display which post type each item is with a button or perhaps a heading block that has a different coloured background depending on which post type it is.
Would this be accomplished by creating multiple conditional blocks and adding the button/heading inside each conditional block or is there a more efficient way of doing it? I don't mind using a bit of html/css if needed.
Also if using the conditional block, would you choose Post Type = Static value and then type in the slug as the static value?
Hello. Thank you for contacting the Toolset support.
There are two ways:
- Either you should create a view per post type and display the view, in this case, you will not have to use coditonal statement as you can add static heading with your post type name and under that you should display your view that displays posts belongs to that post type.
Hi Minesh, thanks for your reply. I think you may have misunderstood my question. It would be a single view, a featured listings view if you like, that would come from multiple post types.
Does this image help explain what I'm trying to achieve?
So, you can add container with different background color per post type and then you can wrap each container with conditional block.
Also if using the conditional block, would you choose Post Type = Static value and then type in the slug as the static value?
==>
Yes, this is correct.