Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #175133

    Great theme – I am about to finish the styling of my site. For the portfolio grid I would love to display the category right below the item title. I have found a similar thread for angus theme (https://kriesi.at/support/topic/category-display-under-portfolio-post-titles/) and hope there might be an easy solution for enfold as well?

    #176175

    Hi,

    Can you post the link to your website please?

    Regards,
    Josue

    #176267

    Hey Josue,
    Sorry – my website isn´t online yet. But I don´t think my website is necessary for an answer to this question, is it?

    #176334

    Hi!

    In /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php replace both occurences of

    
    $output .= '</header>';
    

    with

    
                        $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))
                        {
                            $output .= '<span class="blog-categories minor-meta">';
                            $output .= $cats;
                            $output .= '</span>';
                        }
    $output .= '</header>';
    
    

    Best regards,
    Peter

    #185729

    Thanks Peter, works perfectly! One small question: Is it possible to remove the category links? I just want the category names to be displayed.

    #185768

    Hi!

    Use this code instead:

                        $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))
                        {
                            $output .= '<span class="blog-categories minor-meta">';
                            $output .= strip_tags($cats);
                            $output .= '</span>';
                        }
    $output .= '</header>';

    Regards,
    Josue

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Display category under portfolio title’ is closed to new replies.