Hello!
I found this post that helped me:
https://kriesi.at/support/topic/show-tags-in-portfolio/
However, I am not sure how to add a seperator between each tag. Right now, the tags run into each other.
I would like to separate them with a “|” symbol.
Any help would be greatly appreciated.
Hey flordelizamejia,
Please try this in your child theme functions.php file:
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');
Best regards,
Rikard
Thank you Rikard!
This solution worked out great.
But, when I click on each tag, it brings me to the same page.
How do I have it so that when I click on a tag, it will bring me to a page with similarly tagged items?
Any help would be appreciated.
Hi flordelizamejia,
I inspected it and noticed that no urls are generated.
Can you give us admin access? so we can check on the backend and try to fix it if Appearance > Editor is available.
Just post the login credentials in private content, so it’s only visible to the moderators.
Best regards,
Nikko
Thank you Nikko!
The login credentials are listed in the private content.
Hi flordelizamejia,
Thanks for giving us admin access.
I have modified this part of the code:
$taglink = get_tag_link($tag->tag_id);
to:
$taglink = get_tag_link($tag->term_taxonomy_id);
Let us know if you need further assistance.
Best regards,
Nikko