Shortcodes let you embed AP Family Trees content on any page, post, or widget area using the WordPress Shortcode block. In the Gutenberg editor, add a Shortcode block and enter the shortcode. In classic text editors, paste the shortcode directly into the content.
✎ Note: The shortcode names shown here are the current names registered by AP Family Trees v0.8+. The admin UI refers to trees as Trees (not Family Groups). If you have content using older names from a previous version, test whether they still resolve before updating documentation.
#
Displays a saved chart by its Chart ID. This is the primary shortcode for embedding interactive family tree charts.
[APFTChart id="1"]
| Attribute | Required | Description |
|---|---|---|
id | Yes | The Chart ID. Find this in AP Family Trees → Charts, ID column. |
Example: displays the chart with ID 3.
The chart type, root person, and display settings are all defined on the chart record itself — see Creating a Chart. To show a different chart type or starting point, create a separate chart record and use its ID.
A tree identifier is required. Use [apft-family-tree family=your-tree-slug]
#Displays a family tree using the default chart settings for a specific tree.
[apft-family-tree family="your-tree-slug"]
| Attribute | Required | Description |
|---|---|---|
family | Yes | The tree slug. Find this in AP Family Trees → All Trees. |
root | No | Override the root person for this instance. Use the GEDCOM person ID (e.g. I5). |
align | No | Alignment of the chart. Default: center. |
#
Displays a list of all members in a tree. A readable alternative to the chart, particularly useful on mobile devices.
[apft-family-members family="your-tree-slug"]
| Attribute | Required | Description |
|---|---|---|
family | Yes | The tree slug. Find this in AP Family Trees → All Trees. |
#
Displays all members across all trees.
[apft-members]
No attributes required. Useful for a site-wide members page when you have a single tree, or want to show everyone regardless of which tree they belong to.
Pro #
Displays a member search box. Visitors type a name and see matching members with links to their profile pages.
[apft-search tree="your-tree-slug"]
| Attribute | Required | Description |
|---|---|---|
tree | No | The tree slug to search within. Leave blank to search all trees. |
The Search Block in Gutenberg provides the same functionality with a visual interface - see Gutenberg Blocks.
Pro #
Displays a profile for a specific family member. Use on dedicated profile pages, or with compact="true" to embed an inline card in blog posts and articles.
[apft-profile person="I5" tree="your-tree-slug"]
| Attribute | Required | Description |
|---|---|---|
person | Yes | The person's GEDCOM reference ID (e.g. I5). Found in the member record in the admin. |
tree | Yes | The tree slug the person belongs to. |
compact | No | Set to "true" for a compact card showing photo, name and years only. Default: false (full profile). |
The Family Member Profile Block provides the same output with a visual person picker - see Gutenberg Blocks.
Pro Plus #
Displays a full alphabetical index of members in a tree, each linked to their profile page.
[apft-member-index tree="your-tree-slug" sort="surname" show_birth="true" show_death="true"]
| Attribute | Required | Description |
|---|---|---|
tree | Yes | The tree slug. |
sort | No | Sort order: surname, firstname, fullname, or birthdate. Default: surname. |
show_birth | No | Show birth dates in the index. true or false. Default: true. |
show_death | No | Show death dates in the index. true or false. Default: true. |
Using shortcodes in page builders #
- Divi: use a Text module or Code module and paste the shortcode directly.
- Elementor: use a Shortcode widget.
- Gutenberg block editor: add a Shortcode block and paste the shortcode into it.
Shortcodes work in any WordPress context that processes shortcodes, including widget areas, page builder text blocks, and theme template files using do_shortcode().
