Best Kriesi,
I want to display the taxonomy and categories in the postslider under the post title. can you help me out?
Hey ErikHummel!
The area your looking for is line 386 in /enfold/config-templatebuilder/avia-shortcodes/postslider.php.
$output .= !empty($title) ? "<h3 class='slide-entry-title entry-title' $markup><a href='{$link}' title='".esc_attr(strip_tags($title))."'>".$title."</a></h3>" : '';
On the next line you could use this to display the categories.
$categories = get_the_category($the_id);
if ( ! empty( $categories ) ) {
$output .= '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>';
}
Cheers!
Elliott
Best Elliot,
Thanks for this fix it worked. Can you also tell me how I can display my tags in the postslider? Just like the categories?
and also I want to display a list of all the categories and tags that are added to the posts. Not just the first one
Hi!
You can replace the code with this:
$taxonomies = get_object_taxonomies(get_post_type($the_id));
$cats = '';
$excluded_taxonomies = apply_filters('avf_exclude_taxonomies', array('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 .= $cats;
}
Best regards,
Ismael