How to display attribute description near taxonomies terms
To display very short description text near taxonomies terms use its textarea ‘description‘:
and next code in file functions.php of the current WordPress theme:
add_filter('woof_before_term_name', function ($term, $taxonomy_info) { $description = substr(strip_tags(term_description($term['term_id'])), 20); if (!empty($description)) { //instead of inline CSS you can use CSS classes return $term['name'] . ' <em style="float: right; font-size: 12px;display:inline-block;margin: 4px 0 0 6px;">[' . $description . ']</em>'; } return $term['name']; }, 10, 2);
Results:
Troubles? Ask for Support!