-
vidyutdev
I have a query loop, multiple cards are there… There is a post meta called yatra-updates_temple-status which is single select field, 2 options are there ‘Closed’ and ‘Open’.
I want if a post meta of yatra-updates_temple-status is Closed, background color to be background: rgba(243, 244, 246, 0.5);
https://snipboard.io/ihnaKO.jpg
How to achieve that?
Thanks!
-
Hi there,
Do you have GB Pro?
If so, you can use the conditions feature.
1. Add 2 text blocks, both pulling the value from
yatra-updates_temple-status, one text block with a green icon, one text block with a red icon.2. Create a condition > post meta >
yatra-updates_temple-status, if the value is closed, show the text block with a red icon. https://app.screencast.com/SagOY5qdbJnwI3. Apply the condition to the text block with the red icon.
4. Apply the condition to the text block with the green icon, and tick the Invert condition box.
Let me know if this helps!
-
vidyutdev
No no you didn’t get it…
I’m a GB Pro user. Using conditions from the very first day..
It’s not a text block or so…. It’s the whole loop item, which has a background of white, now if the item meta of yatra-updates_temple-status is = Closed, i wanna reduce the background opacity of that loop item card..
-
In that case, you can use a WP custom HTML block to insert CSS and apply the condition to it, so if the value is closed, the CSS will be inserted.
-
vidyutdev
Didn’t get that.. How the html block would add the css to any of those loop item cards?
-
vidyutdev
I got this…. I added a Container with absolute position, inset 0, and that bg color, and added the condition…
Thanks…
-
Great! Glad you got it 😛 Good job!
- You must be logged in to reply to this topic.