Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Description of Shortcode for Staff Email
//How Conditional Shortcodes work to diplay this
[wpbb-if some-field-connection-shortcode]
<a href="[some-field-connection-shortcode]">my email icon</a>
[wpbb-if post:acf type='url' name='church_information_staff_email']
<a href="mailto:[wpbb post:acf type='url' name='church_information_staff_email']"><span class="fas fa-envelope-open"></span></a>
//What we have here is a Beaver Builder shortcode that is conditional.
//What it is saying is this IF the field for staff email is filled in
//THEN display the envelope icon and link it to the staff email.
Here's my IF:
[wpbb-if post:acf type='url' name='church_information_staff_email']
Here's the icon with the link:
[<a href="mailto:[[wpbb post:acf type='url' name='church_information_staff_email']]"><span class="fas fa-envelope-open">]
Here's my closing:
Copy link

Obviously, don't just copy this code. This is just a description of the code I have for another Gist.

Used in a post on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment