Tag or Category term_group Order
Adds a group field to tags and categories, allowing to sort them based on term_group order.
Plugin info
Maintenance & Compatibility
Maintenance score
Possibly abandoned • Last updated 3560 days ago • 2 reviews
Is Tag or Category term_group Order abandoned?
Possibly abandoned (last update 3560 days ago).
Compatibility
Languages
Similar & Alternatives
Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.
Description
This plugin is intended as an aid to theme and plugin developers. It changes the term_group field value in a core WordPress database table
($wpdb->terms). So, please be aware of the risks involved and always back up your site before activating a new plugin.
The purpose of the plugin is to allow sorting of tags or categories based on ‘term_group’. This allows queries that
fetch terms to use ‘term_group’ as a sort order.
This can be used to display tags or categories in a semantic way in archives and individual posts.
For example,
If we have three groups of categories for size, color and object, then categories displayed as
Small, Green, Table
Big, Blue, Chair
are more readable than
Table, small, green
Chair, big, blue
Installation
-
Upload the category term_group order folder to /wp-content/plugins/.
-
Activate the plugin through the “Plugins” menu in WordPress.
-
You will now be able to set a ‘Group’ field for categories.
-
Paste the following code in single.php , index.php , archive.php to display the categories based on term_group order
$args = array(‘orderby’ => ‘term_group’, ‘order’ => ‘ASC’, ‘fields’ => ‘all’);
$terms = wp_get_object_terms($post->ID, ‘category’, $args );
$count = count($terms);
if($count > 0){
echo ‘Posted in
- ‘;
- slug, ‘category’).'”>’.$term->name.’ .
foreach ($terms as $term) {
echo ‘
‘;
}
echo ‘
‘;
}
Frequently Asked Questions
This is the first version of the plugin. So, no FAQ yet.
Review feed
Changelog
0.2.2
- Tested up to WordPress 4.5
0.2
- Added style.css
0.1
- This is the first version of this plugin.
