>
Download This Plugin | |
Download Elegant Themes | |
Name | Peer Categories |
Version | 2.0.2 |
Author | Scott Reilly |
Rating | 0 |
Last updated | 2015-02-11 05:26:00 |
Downloads |
2966
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Peer Categories plugin added 4 bytes of resources to the Home page and 6 bytes of resources to the sample Post page.
Peer Categories plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Peer Categories plugin ads no tables to your Wordpress blog database.This plugin provides a template tag which acts a modified version of WordPress's built-in template tag, the_category()
. the_category()
lists all categories directly assigned to the specified post. c2c_peer_categories()
lists those categories PLUS any categories that are peer to those categories and MINUS categories that are parents to other assigned categories. Peer categories are categories that all share the same category parent.
For example, assume your category structure is hierarchical and looks like this:
Vegetables
|-- Leafy
| |-- Broccoli
| |-- Bok Choy
| |-- Celery
|-- Fruiting
| |-- Bell Pepper
| |-- Cucumber
| |-- Pumpkin
|-- Podded
| |-- Chickpea
| |-- Lentil
| |-- Soybean
If you directly assigned the categories "Fruiting" and "Pumpkin" to a post, peer_categories()
would return a list that consists of: "Bell Pepper", "Cucumber", and "Pumpkin". Notice that since "Fruiting" was a parent to a directly assigned category, it and its peers are not included in the list. If only "Fruiting" were selected as a category, then "Leafy", "Fruiting", and "Podded" would have been listed.
By default, categories are listed as an HTML list. The first argument to the template tag allows you to define a custom separator, e.g. to have a simple comma-separated list of peer categories: <?php c2c_peer_categories(','); ?>
.
As with categories listed via the_category()
, categories that are listed are presented as links to the respective category's archive page.
Example usage (based on preceding example):
<?php c2c_peer_categories(); ?>
Outputs something like:
<ul><li><a href="http://yourblog.com/category/fruiting/bell-pepper">Bell Pepper</a></li>
<li><a href="http://yourblog.com/category/fruiting/cucumber">Cucumber</a></li>
<li><a href="http://yourblog.com/category/fruiting/pumpkin">Pumpkin</a></li></ul>
<?php c2c_peer_categories( ',' ); ?></ul>
Outputs something like:
<a href="http://yourblog.com/category/fruiting/bell-pepper">Bell Pepper</a>, <a href="http://yourblog.com/category/fruiting/cucumber">Cucumber</a>, <a href="http://yourblog.com/category/fruiting/pumpkin">Pumpkin</a>
Links: Plugin Homepage | Plugin Directory Page | Author Homepage