Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ssnepenthe/terms-archive
A WordPress plugin for creating frontend terms archives.
https://github.com/ssnepenthe/terms-archive
php wordpress wordpress-plugin
Last synced: 10 days ago
JSON representation
A WordPress plugin for creating frontend terms archives.
- Host: GitHub
- URL: https://github.com/ssnepenthe/terms-archive
- Owner: ssnepenthe
- License: gpl-2.0
- Created: 2017-02-10T02:47:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-17T19:24:44.000Z (almost 6 years ago)
- Last Synced: 2024-05-05T09:21:53.607Z (7 months ago)
- Topics: php, wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 86.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terms-archive
This plugins creates archive pages for terms in public taxonomies.## Requirements
WordPress 4.7 or later, PHP 5.4 or later and Composer.## Installation
```
$ composer require ssnepenthe/terms-archive
```OR
```
$ cd /path/to/project/wp-content/plugins
$ git clone [email protected]:ssnepenthe/terms-archive.git
$ cd terms-archive
$ composer install
```## Usage
To start, you need to add theme support for any taxonomy you wish to add an archive page for. Any of the following are valid ways to do so:```
add_theme_support( 'ta-terms-archive' ); // Adds support for all public taxonomies.
add_theme_support( 'ta-terms-archive', 'category' ); // Adds support for the category taxonomy.
add_theme_support( 'ta-terms-archive', [ 'category', 'post_tag' ] ); // Adds support for categories and tags.
```Additionally, you need to create at least one of the following template files:
* ta-terms-archive-{$taxonomy}.php
* ta-terms-archive.phpWhere $taxonomy is the string given as the first param to `register_taxonomy()`.
A number of functions are available to aid in theme development and can be found in `inc/functions.php`. They should feel very familiar if you have any experience developing WordPress themes.
Check `examples/tf-child/` for an example implementation in the form of a `twentyfifteen` child theme.
Once you have completed the above and activated the plugin, you will be able to view lists of all terms which have associated posts and are in a public taxonomy from the frontend.
You can find these archive pages at `{home url}/{wp rewrite front}/{tax rewrite slug}`.
For example, if your site lives at `https://example.com` and your permalink structure is set to `/blog/%postname%/`, you will be able to access categories at `https://example.com/blog/category/`.
If you want to disable archive pages for specific taxonomies, you can do so by visiting `Settings > Terms Archive` and selecting the taxonomies you wish to disable.