>
Download This Plugin | |
Download Elegant Themes | |
Name | Custom Taxonomy Sort |
Version | 1.1.5 |
Author | Zack Tollman |
Rating | 96 |
Last updated | 2011-07-16 01:53:00 |
Downloads |
12877
|
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%
Custom Taxonomy Sort plugin added 24 bytes of resources to the Home page and 50 bytes of resources to the sample Post page.
Custom Taxonomy Sort plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Custom Taxonomy Sort plugins ads the following DB table(s) to your Wordpress blog database:Table name | Table size (in bytes) |
---|---|
wp_termmeta | 49152 |
Surprisingly, WordPress does not provide a mechanism for sorting taxonomies by a custom defined order. Taxonomies can only be sorted by name or id. Custom Taxonomy Sort allows the average user a mechanism to define and display terms in a specified order. After installing Custom Taxonomy Sort, each taxonomy term will have the ability to have a "tax-order" value associated with it. This order is specified by doing the following:
Custom Taxonomy Sort automatically applies the sort order to all instances in which the terms are displayed. All you need to do is define that order.
In addition to automatically sorting the terms, Custom Taxonomy Sort allows developers to override the automatic sort to offer finer control over how terms are displayed in different parts of WordPress. Manual mode can be started by changing "Automatic Sort" to "Off" in the Custom Taxonomy Sort Settings page (wp-admin/options-general.php?page=custom-taxonomy-sort-settings). Once "Automatic Sort" is switched to "Off", the terms will no longer be sorted automatically by the custom order. Instead, the custom sort order can be envoked with a new parameter for the "orderby" argument. Custom Taxonomy Sort allows you to use the following argument to access a custom sorted list of terms using "get_terms"
<?php get_terms('orderby=custom_sort'); ?>
Voila! Now, your terms will only be sorted by the specified order in the places that you want it sorted in this order. All other instances of displaying terms will revert to WordPress' default of sorting the terms by name. Additionally, you can specifically have the terms sort in ascending ('ASC'; default; e.g., 1, 2, 3) or descending ('DESC'; e.g., 3, 2, 1) order by adding the "order" argument.
<?php get_terms('orderby=custom_sort&order=ASC'); ?>
<?php get_terms('orderby=custom_sort&order=DESC'); ?>