The A-Z Listing facet type displays a list of available first letters of the chosen Data Source field content.

Click on a letter to show results starting with that letter. Click the selected letter again, or the “Any” link, to reset the facet.

FacetWP AZ-Listing alpabetical facet

Available options

Name Description
Data source The post attribute or custom field to be used for the first letter.
Default label Change the default “Any” label. Note: this label is translatable with the facetwp_i18n hook.

Using other alphabets or languages

The A-Z listing facet will only show the capital letters A to Z in the standard Latin alphabet. It cannot show letters from other types of languages.

The first letters of the results are compared to these letters, after being stripped from their accents with WP’s built-in remove_accents function.

Using lowercase letters

If you need the letters to show as lowercase, you can do so with a bit of CSS. Add the following to your (child) theme’s functions.php:

How to use custom PHP code?

PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_action( 'wp_head', function() { ?> <style> .facetwp-type-alpha .facetwp-alpha { text-transform: lowercase; } </style> <?php }, 100 );

Changelog

1.3.9

  • New added "Default label" UI setting, which is also now translatable

1.3.7

  • Improved clicking an already-select letter will unselect it

1.3.6

  • Fixed Support new accessibility feature

1.3.5

  • Fixed Added class "selected" for consistency

1.3.4

  • Improved Removed jQuery dependency

1.3.3

  • Fixed cast characters as BINARY to avoid encoding issues

1.3.2

  • Changed renamed i18n namespace to "fwp-front" to align with FacetWP core