Archived topic
Hide a block if a post meta is empty
3 replies · Started by twarrior on August 30, 2022
Hello,
We are a creating a Content Template.
We have a custom post field called "member number"
we want to display in posts: "Member number: XXXX".
"XXXX" is dynamically changed to the value of "member number".
BUT.... not all posts have a "member number".
so we would like it not to be displayed in those cases. Is it possible?
thanks
PS: currently XXXX is not shown, but the "Member number:" text is.
Hi there,
You are currently using 2 headline blocks, one for the text Member number, the other one for the actually post meta value.
Can you try using only one headline block and the before text option?
https://www.screencast.com/t/e6ZTbNb8IOp3
Thanks, but i would like to format (bold, icon, etc) separately.
Maybe with genaratebloxks pro?
You can add icons to the headline, but to style them separately is not possible, unfortunately, even with GB pro.
There's another workaround is to use Pseudo element CSS, something like this:
h3.gb-headline.gb-headline-f02c23d4.gb-headline-text:before {
content: "Member Number: ";
font-weight: bold;
}