Skip to content

Instantly share code, notes, and snippets.

@iamandrewpeters
Last active October 31, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamandrewpeters/1518e5e229fc6cb8ebfc82e7d8b44d67 to your computer and use it in GitHub Desktop.
Save iamandrewpeters/1518e5e229fc6cb8ebfc82e7d8b44d67 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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