Bricks very usefully allows querying multiple post types with the query loop. To compliment this, could a condition of Post Type be added to the choices when setting up an element condition?
In my use case I want to add an extra image to a card for posts of type A, but not type B.
I need to be able to use condition to show some element when a session variable has a certain value.
E.g. $_SESSION[‘Logged’] != “NO”.
how can I implement it?
Mmmmh, what kind of application can you think of?
I was unsure for a moment (and the condition is not there, you’re right), because in general you define the structure of the post type via the template and in it you can define further elements (but the condition post type is already fulfilled).
I can also define sections as template and define the custom posttype as condition.
I just can’t think of an area of application right now. What was your idea?
Hey Sebastian, as I said in the OP, this request came about because I had a query loop querying two post types and I wanted to show an element for one type but not for the other. So it’s not relating to a page template but a query loop querying more than one post type.
Then I got you wrong. My bad!
A very specific request but yes it would be nice if that would be possible!
I have no idea how to build something like this ui based, because the conditions in general are above the query loops and apart from the taxonomy filters this would be a whole level lower.
Is it that specific? I’m making a Search Results template for a site that has both blog posts and products. It would be great to have buttons for “Read more” or “Add to cart” only appear for the relevant post type instead of both.
This seems like something would be a fairly common occurrence so I’m surprised it’s not easily doable.