View Categories

Shortcode Reference

3 min read

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"]
AttributeRequiredDescription
idYesThe Chart ID. Find this in AP Family Trees → Charts, ID column.

Example:

Building chart...

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"]
AttributeRequiredDescription
familyYesThe tree slug. Find this in AP Family Trees → All Trees.
rootNoOverride the root person for this instance. Use the GEDCOM person ID (e.g. I5).
alignNoAlignment 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"]
AttributeRequiredDescription
familyYesThe 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"]
AttributeRequiredDescription
treeNoThe 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"]
AttributeRequiredDescription
personYesThe person's GEDCOM reference ID (e.g. I5). Found in the member record in the admin.
treeYesThe tree slug the person belongs to.
compactNoSet 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"]
AttributeRequiredDescription
treeYesThe tree slug.
sortNoSort order: surname, firstname, fullname, or birthdate. Default: surname.
show_birthNoShow birth dates in the index. true or false. Default: true.
show_deathNoShow 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().

Submit a Comment

Your email address will not be published. Required fields are marked *