-
AuthorPosts
-
February 23, 2014 at 9:30 pm #228210
Under the post titles you usually get
Date / in Category 1, Category under 1, Category under the one under 1/ By person who made the postIf I have
Category one
–Category two
—-Category threeHow can I modify the template so that it does not list all the categories but ONLY the deepest one which in this example would be
Date / in Category three / By person who made the postThis is because I do not want to show all the categories above the one we are in as links as I would rather have people navigate via the navigation instead of clicking those posts breadcrumbs. I guess it has to be in here within the template
$taxonomies = get_object_taxonomies(get_post_type($the_id)); $cats = ''; $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), get_post_type($the_id), $the_id); if(!empty($taxonomies)) { foreach($taxonomies as $taxonomy) { if(!in_array($taxonomy, $excluded_taxonomies)) { $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' '; } } } if(!empty($cats)) { echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." "; echo $cats; echo '</span><span class="text-sep text-sep-cat">/</span>'; }
February 24, 2014 at 1:47 am #228271Actually I just realized that these are ordered alphabetically which I suspect makes it impossible to simply sort or filter by death…or is it?
February 24, 2014 at 8:20 am #228365Hi!
Unfortunately the default get_the_term_list() function does not support such a feature and this modification is beyond the scope of our support forum. This code snippet may help you to implement your idea: http://pluginus.net/archives/get-the-term-list-ordered-by-hierarchy though.
Regards,
Peter -
AuthorPosts
- You must be logged in to reply to this topic.