Skip to main content

Once some profiles have been created, you can display them on your site in a gallery. You can display all the profiles in one gallery or you can display smaller groups of profiles which we call Divisions.

Base Shortcode

A gallery can be displayed in either a single-column or multi-column view. Either of these base shortcode will display all published profiles sorted alphabetically by last name then first name. Simply copy the shortcode below and paste it into a page where you wish to display a gallery.

Single Column

[unc_directory]

Example of a single column directory.

Multi Column

[unc_directory multi-column="true"]

 

Example of a multi-column directory.


Display Profiles For A Specific Division

(View the Divisions documentation to learn how to set up a division as well as how to include profiles in a division.)

Rather than display all profiles in a gallery, you can display smaller groups which we call Divisions. Some of the most popular divisions include: Faculty, Staff, Administration, Residents and Researchers. Some sites like to break their people into divisions that are specific to the department. For example, the Department of Obstetrics and Gynecology uses divisions such as Family Planning, General Obstetrics and Gynecology, Global Women’s Health, Gynecologic Oncology, Maternal-Fetal Medicine, Midwives, etc. The Lineberger Comprehensive Cancer Center displays their members by program: breast cancer, cell biology cancer, immunology, cancer prevention and control, etc.

To limit a gallery to display only profiles tagged with a specific division, add the division="" attribute to the base shortcode. Add the slug of the desired division within the quotes. This MUST be the slug of the division, not the name of the division.

How To Find A Division Slug

  1. Select SOM Directory > Division in the dashboard.
  2. The table on the Divisions page has a column that displays the slug name. This is what gets added to the shortcode.

Screenshot highliting the Slub column.

Example

The example below uses the multi column layout and will display all published profiles tagged with the Breast Cancer division.

[unc_directory multi-column="true" division="breast-cancer"]


Limit The Information Displayed

By default, a gallery will display the profile title (person’s name), first two positions (professional titles), contact information (phone and email) and gallery summary for every profile. The following modifiers will allow you to remove some of these fields from a gallery. Add any of the following modifiers to one of the base shortcode.

Hide Position Titles

Add the hide-position-titles="true" modifier to the base shortcode.

Hide Contact Information

Add the hide-contact-info="true" modifier to the base shortcode.

Hide Gallery Summary

Add the hide-gallery-summary="true" modifier to the base shortcode.

Example

The example below will display a singe column gallery with only the photo and Name for each profile since the Titles, Contact Information, and Gallery Summary have all been hidden.

[unc_directory hide-position-titles="true" hide-contact-info="true" hide-gallery-summary="true"]


Add a Search Bar

This modifier adds a search bar to the gallery that allows site visitors to search the profiles. Add the searchable="true" modifier to one of the base shortcode.

IMPORTANT: This modifier can only be used once on any given page.

Example

The example below will display a multi-column gallery with the search enabled.

[unc_directory multi-column="true" searchable="true"]

Example of a directory gallery with the search bar across the top.


Override Sort Order

Profiles automatically sort alphabetically by last name in a gallery view. However, profiles can override the alphabetical sort and display ahead of other profiles using the Sort Order field on profile pages. See the Create a Profile page for more information about Sort Order.

The following modifier will ignore any priority placement using Sort Order. It will truly display all profiles alphabetically by last name, then first name. To override the sort order, add alpha-sort-only="true" to one of the base shortcode.

This modifier should not be used with the ‘ID’ modifier (see below).

Example

The example below will display a multi-column gallery that ignores the priority placement of profiles using the Sort Order feature.
[unc_directory multi-column="true" alpha-sort-only="true"]


Display Specific Profiles By ID

This modifier lets you display specific profiles by their ID. The profiles will display in the order in which the ID’s are listed. This modifier will ignore Sort Order as well as the Division modifier. Add ids="" to one of the base shortcode. Add a comma separated list of post IDs’ within the quotes.

Example

The example below will display a multi-column gallery of the specified profiles.
[unc_directory multi-column="true" ids="2925,3101,3195"]

How To Find The Post ID

    1. Edit a profile
    2. In the browser’s address bar, look for post= in the url. The number following that is the ID that should be listed in the shortcode.
    3. Example: In the following url, 59519 is the post ID.
      https://www.med.unc.edu/medicine/oncology/wp-admin/post.php?post=59519&action=edit

Pagination

Pagination can be added to galleries with an abundance of profiles. Add paginate="true" to a base shortcode to enable the pagination. By default, 12 profiles will display per page. To set a custom number of profiles to display per page, add posts-per-page="". Add the desired number in the quotes.

IMPORTANT: This modifier can only be used once on any given page.

Example

The example below will display a multi-column gallery that displays 21 profiles per page.
[unc_directory multi-column="true" paginate="true" posts-per-page="21"]

Example of a directory gallery with pagination.