Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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 post

    If I have
    Category one
    –Category two
    —-Category three

    How 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 post

    This 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>';
                        }
    #228271

    Actually I just realized that these are ordered alphabetically which I suspect makes it impossible to simply sort or filter by death…or is it?

    #228365

    Hi!

    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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.