CP Staff provides two shortcodes for embedding staff listings on any page or post. Use these when you want more control over where and how staff appear on your site.
Staff Archive Shortcode
Display the complete staff directory, identical to the default archive page:
[cp_staff_archive]
This renders the full archive.php template with hierarchical department grouping. It accepts no parameters — use [cp_staff_list] for filtered or customized listings.
Staff List Shortcode
Display a customized list of staff members:
[cp_staff_list]
Parameters
| Parameter | Description | Example |
|---|---|---|
cp_department |
Show only staff from specific department slugs (comma-separated) | cp_department="pastoral-staff" |
exclude_cp_department |
Exclude staff from specific department slugs | exclude_cp_department="support" |
static |
Disable click actions, email, and phone icons | static="true" |
The shortcode also supports department as a legacy alias for cp_department.
Examples
Show staff from a single department:
[cp_staff_list cp_department="worship-team"]
Show staff from multiple departments:
[cp_staff_list cp_department="pastoral-staff,worship-team"]
Exclude a department:
[cp_staff_list exclude_cp_department="administrative"]
Static display with no interactive features:
[cp_staff_list cp_department="leadership" static="true"]
Combine parameters:
[cp_staff_list cp_department="leadership" exclude_cp_department="support" static="true"]
Query Customization
Developers can modify the underlying query using the cp_staff_list_query_args filter:
add_filter( 'cp_staff_list_query_args', function( $args, $atts ) {
// Limit to 6 staff members
$args['posts_per_page'] = 6;
return $args;
}, 10, 2 );
The default query retrieves all published cp_staff posts ordered by menu_order ASC, title ASC with a limit of 999.
Output Structure
The [cp_staff_list] shortcode renders staff cards in a grid:
<div class="cp-staff-grid">
<!-- Individual staff cards via parts/staff-card.php -->
</div>
For styling options, see CSS Styling. For template customization, see Template Overrides.
