Skip to content

Instantly share code, notes, and snippets.

Embed
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]
[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>
[/wpbb-if]
//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:
[/wpbb-if]
@iamandrewpeters

This comment has been minimized.

Copy link
Owner Author

@iamandrewpeters iamandrewpeters commented Oct 31, 2018

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 https://wpfor.church

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