-
AuthorPosts
-
October 14, 2013 at 4:30 pm #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?
October 16, 2013 at 4:49 am #176175Hi,
Can you post the link to your website please?
Regards,
JosueOctober 16, 2013 at 8:52 am #176267Hey 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?October 16, 2013 at 10:17 am #176334Hi!
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,
PeterNovember 7, 2013 at 6:01 pm #185729Thanks Peter, works perfectly! One small question: Is it possible to remove the category links? I just want the category names to be displayed.
November 7, 2013 at 7:31 pm #185768Hi!
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 -
AuthorPosts
- The topic ‘Display category under portfolio title’ is closed to new replies.