Hi,
A while ago you’ve given me advise how to show categories in portfolio (when using avia layout builder), see https://kriesi.at/support/topic/show-categories-and-tags-in-portfolio/#post-673578.
Could you give me the same for showing tags in portfolio please?
Thanks & regards,
Monique
Hey Monique,
Please add following code to Functions.php file in Appearance > Editor
function show_portfolio_tags_func() {
global $post;
$the_tags = get_the_tags( $post->ID , 'portfolio_entries');
$output = '';
foreach($the_tags as $tag) {
$taglink = get_tag_link($tag->tag_id);
$output .= '<span class="portfolio_tag"><a href='.$taglink.'>'.$tag->name.' </a></span>';
}
return $output;
}
add_shortcode('portfolio_tags', 'show_portfolio_tags_func');
then insert [portfolio_tags] shortcode to your portfolio posts :)
Best regards,
Yigit
Wow Yigit, that works great!
Some extra CSS and it looks great too!
Can you please flag this topic as closed?
Thanks & best regards,
Monique