Using Shortcodes with the UUA WordPress Theme for Congregations
What Is a Shortcode?
A shortcode is a WordPress-specific code that you can include in the text of a page to display information. A shortcode can display a file or display information that would normally require lots of complicated, ugly code in just one line. Shortcode = shortcut. (More information.)
Enclose the shortcode in square brackets and enter it on a line by itself.
Shortcodes Included with the UUA Theme and Services Plugin
- [uuatheme_map] – Shows a google map of the specified address.
- [uua_staffer] – Shows a list of staff profiles from the Staffer plugin. Deprecated.
- [uua_testimonials] – Shows five testimonials from the Testimonials by WooThemes plugin. Deprecated.
- [uua_services] – Shows a list of services from the UUA Services plugin.
Map Shortcode: [uuatheme_map]
Displays a Google Map of the address entered. You can add your Google API Key to the Customizer > Congregation Map settings for more advanced map options. If you don't, it defaults to the free embedded map.
You can use the following attributes with the [uuatheme_map] shortcode:
- address – (Required) Specify the address for the map.
- width – The width of the embedded map. Defaults to 100%
- height – The height of the embedded map. Defaults to 400px
[uuatheme_map address="6300 A Street, Lincoln, NE 68510"]
Staff Shortcode: [uua_staffer]
Lists the staffers from the Staffer plugin.
The [uua_staffer] shortcode will be removed in a future release of the UUA Theme. We recommend using the [staffer] shortcode included with the Staffer plugin instead.
Example: List staff in the RE department in ascending order by staff name:
Testimonial Shortcode: [uua_testimonials]
Lists five testimonials from the Testimonials by WooThemes plugin.
The [uua_testimonials] shortcode will be removed in a future release of the UUA Theme. We recommend using the [woothemes_testimonials] shortcode included with the Testimonials by WooThemes plugin instead.
Example: List 10 testimonials and hide the author information:
[woothemes_testimonials limit="10" display_author="false"]
Services Shortcode: [uua_services]
Displays services by type with support for pagination, and sorting, replacing the need for these shortcodes: [upcoming-services] or [service-archive]. (These shortcodes, which were introduced with version 1.0 of the theme and Services plugin, will continue to work.)
You use the type attribute to specify which listing you want. The type can be "upcoming" or "archive". If you omit the type, the default value is "upcoming".
Example 1: List the upcoming services:
Example 2: List an archive of past services, with most recent services first:
We'll introduce other attributes in future versions of the plugin.
Shortcodes Included with Recommended Plugins
These shortcodes are not part of the UUA theme or Services plugin. The explanation of each shortcode includes the name of the plugin from which it comes.
Displays a list of event categories (which are explained in the Events Manager plugin documentation). Choose Events > Event Categories from the Dashboard to see and add to the list of event categories (which are different from news post categories).
Displays a list of news posts in a single category. E.g., [ catlist name="news" ]. Choose Posts > Categories from the Dashboard to see and add to the list of post categories (which are different from event categories). (List Category Posts plugin)
[contact-form to=’info [at] yourcongregation [dot] org’][subject=’Contact from the Website’][contact-field label=’Name’ type=’name’ required=’1’/][contact-field label=’Email’ type=’email’ required=’1’/][contact-field label=’Comment’ type=’textarea’ required=’1’/][/contact-form]
Display a contact form via the Jetpack plugin. Replace “info [at] yourcongregation [dot] org” with the email address to which form entries should be sent.
Displays a calendar of events. (Events Manager plugin).
Displays a list of events, with lots of options (which are explained in the Events Manager plugin documentation). This plugin offers a number of other shortcodes.
Displays a carousel, also known as a slider or slideshow. (CPT Bootstrap Carousel plugin)
Lists locations where events can occur. Choose Events > Locations from the Dashboard to add locations. (Events Manager plugin)