https://github.com/interconnectit/a-z-archive
Plugin that adds A-Z archive functionality to WordPress
https://github.com/interconnectit/a-z-archive
Last synced: about 1 year ago
JSON representation
Plugin that adds A-Z archive functionality to WordPress
- Host: GitHub
- URL: https://github.com/interconnectit/a-z-archive
- Owner: interconnectit
- Created: 2012-07-27T10:32:27.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2024-11-18T12:35:52.000Z (over 1 year ago)
- Last Synced: 2025-04-02T22:33:07.918Z (about 1 year ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 2
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A-Z Archive
## Features
* Post type archive that lists posts in alphabetical order.
* Filter posts by letter or symbol.
## Requirements
* PHP >= 8.1
* WordPress >= 5.8
## Usage
Set the `alpha_sort` support for your post type.
```php
register_post_type( 'post_type_name', [
...,
'supports' => [ 'title', 'editor', 'thumbnail', 'alpha_sort' ],
...
] );
```
Or
```php
add_post_type_support( 'post_type_name', 'alpha_sort' );
```
To show the filters on the post type archive page use the following code in your theme template file.
```php
ICIT\StandFirst\PostSort\AtoZ::post_type_alpha_filters( 'post_type_name', [ 'title'=> 'Filters', 'all_title' => 'All Posts' ] );
```