How I do pseudo-conditional fields
-
For such a great plugin it seems a shame the author doesn’t have the time to support it. I saw this ticket was closed without an answer, and I really needed this too. So this is what I did to hide the social media links if the staff member didn’t have FB or Twitter:
First, in the template loop, I wrapped the whole FB icon with the link and gave it an ID that included the link itself, like so:
<a href="[staff-facebook]" target="_blank" id="fb-[staff-facebook]"><i class="dashicons dashicons-facebook"></i></a>So if the staff person doesn’t have a Facebook account to link to, the ID for that icon will ALWAYS be the same, meaning
id="fb-".Next, in my stylesheet I used selectors to hide that id, like so:
.staff-member-info-wrap a[id="fb-"] {display: none;}Did the same thing with Twitter and now they’re all hidden. Of course I’d prefer if the markup was never output in the first place, but until the author can build in conditional fields, this is what I’ll be using.
The topic ‘How I do pseudo-conditional fields’ is closed to new replies.