-
Anonymous
Hello,
I have a grid/query loop at the top of this page under “top bakeries in & around Lancaster, PA”: https://www.lanclocal.com/lancaster-pa/bakeries/
I’d like to update only one business to have content pull in under “what locals love.” Is there a way to only update one item from the grid (so that I could “what locals love” to the first one and not to the other three) OR is there a way to have a block like “what locals love” to disappear if another block in the same post template is empty?
Thanks! -
David
Hi there,
a way to have a block like “what locals love” to disappear if another block in the same post template is empty
this could be possible with some simple CSS.
For example:
Container Block #1 with a CSS class of: <code>may-have-dynamic</code> ---- Heading "what locals love" ---- Heading dynamic data with a CSS class of: <code>is-dynamic</code>
Then you can use the
:has()
relational pseudo-class in some CSS eg..may-have-dynamic { display: none; } .may-have-dynamic:has(.is-dynamic) { display: block; }
This will show the
may-have-dynamic
container if it containsis-dynamic
elements.Alternatively we could look at a PHP method to remove blocks based on some condition, eg. the existence of a custom field value or maybe a post count in the loop.
Let me know
-
Anonymous
Thank you!
-
You’re welcome
- You must be logged in to reply to this topic.