-
Notifications
You must be signed in to change notification settings - Fork 0
Shortcode References
Ethan Lin edited this page Nov 7, 2025
·
1 revision
AlphaListing includes a shortcode so you can render the directory without editing templates. The simplest usage outputs the default page listing:
[alphalisting]
- Specific post type:
[alphalisting display="posts" post-type="post"]
- Filter posts by taxonomy and term:
[alphalisting display="posts" post-type="post" taxonomy="category" terms="my-term-slug"]
- Show only child pages of a specific page:
[alphalisting display="posts" post-type="page" parent-post="24"]
- Include descendants of any depth for a page:
[alphalisting display="posts" post-type="page" parent-post="24" get-all-children="yes"]
- Display taxonomy terms instead of posts:
[alphalisting display="terms" taxonomy="category"]
- Limit taxonomy terms to a branch of the tree:
[alphalisting display="terms" taxonomy="category" parent-term="42"]
[alphalisting display="terms" taxonomy="category" parent-term="42" get-all-children="yes"]
- Override the alphabet:
[alphalisting display="posts" alphabet="Aa,Bb,Cc,Dd,Ee,Ff,Gg,Hh,Ii,Jj,Kk,Ll,Mm,Nn,Oo,Pp,Qq,Rr,Ss,Tt,Uu,Vv,Ww,Xx,Yy,Zz"]
- Append numbers to the alphabet:
[alphalisting display="posts" numbers="after"]
- Prepend numbers before the alphabet:
[alphalisting display="posts" numbers="before"]
- Group all numeric items together:
[alphalisting numbers="after" group-numbers="yes"]
- Create grouped ranges of letters:
[alphalisting grouping="3"]
All shortcode arguments are optional—omit any attributes you do not need.
Fine-tune the shortcode with the following attributes. Unless otherwise noted, each attribute accepts a single value.
-
display: Choose whether to list posts (posts, default) or taxonomy terms (terms). Any other value falls back to posts. -
numbers: Show numeric headings before (before) or after (after) the alphabet. Defaults to not displaying numbers and falls back to appending them when set incorrectly. -
grouping: Group letters together. Provide a number greater than1to create ranges (for example,3producesA-C,D-F, and so on). Set tonumbersto group numerals into0-9. Invalid values disable grouping. -
group-numbers: Acceptstrue,yes,on, or1to collect all items that start with a numeral into a single section. Defaults tofalse. -
symbols-first: Acceptstrue,yes,on, or1to move the symbol bucket ahead of the alphabet. Defaults tofalse. -
alphabet: Override the alphabet used for headings. Provide a comma-separated list where the first character in each group becomes the heading. When omitted, AlphaListing uses a locale-aware default or a translation from GlotPress.
-
post-type: Comma-separated list of post-type slugs to include. Defaults topage. -
parent-post: Only show posts that are descendants of the given parent post ID. Combine withget-all-children="yes"to include the full hierarchy. Defaults to unset. -
exclude-posts: Comma-separated list of post IDs to hide. Defaults to unset. -
taxonomy: When filtering posts by terms, provide the taxonomy slug here. Defaults to unset. -
terms: When filtering posts, provide the term slugs. Requires thetaxonomyattribute and accepts a comma-separated list. Defaults to unset.
-
taxonomy: Comma-separated list of taxonomy slugs to display. Defaults to unset. -
terms: Only include specific term IDs. Requires thetaxonomyattribute and cannot be used withexclude-terms. Defaults to unset. -
exclude-terms: Comma-separated list of term IDs to hide. Requires thetaxonomyattribute and cannot be used withterms. Defaults to unset. -
parent-term: Restrict the listing to terms descending from this slug. Combine withget-all-children="yes"to include deeper levels. Defaults to unset. -
get-all-children: Acceptstrue,yes,on, or1to include descendants of any depth when usingparent-term. Defaults tofalse. -
hide-empty-terms: Acceptstrue,yes,on, or1to suppress terms that have no associated posts. Defaults tofalse.
These values are available for completeness and rarely need adjustment.
-
target: Set a fallback URL for letter links when no matching items exist. Defaults to unset. -
return: Choose whether the shortcode returns the full listing (listing, default) or just the letter navigation (letters).