-
AuthorPosts
-
November 2, 2014 at 8:13 am #344812
Hello, how can I get a list of tags (with links) on the individual portfolio items entries?
As a reference imagine I have a portfolio page and this page has tags:
Tag 1
Tag 2
Tag 3I would like to be able to display this list of tags with their respective links somewhere within the page.
Thanks.
November 2, 2014 at 6:51 pm #344935Hi momon!
Your portfolio entries should have the tags displayed by default. Make sure Enfold is updated and send us a link so we can take a closer look. You can set the link as private if you wish.
Cheers!
ElliottNovember 3, 2014 at 2:56 am #345032This reply has been marked as private.November 4, 2014 at 4:15 am #345704Hi!
Thank you for the link.
Portfolio items built from the advance layout builder will not render tags by default. You can add this on functions.php:
add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1); function avia_add_social_toolbar_template_builder($content = "") { if(is_singular('portfolio')) { $content .= '<span class="blog-tags minor-meta">'; $content .= the_tags('<strong>'.__('Tags:','avia_framework').'</strong><span> '); $content .= '</span></span>'; } return $content; }Cheers!
IsmaelNovember 4, 2014 at 5:38 am #345726Thank you Ismael, I ended up creating a shortcode for it instead which allowed me to position the tags anywhere in the content instead which is a bit more flexible.
I am sharing my code bellow in case someone wants to do the same:
function psc_pagetags( ){ $t = wp_get_post_tags(get_the_ID()); foreach ($t as $e) { $psc_tags .= '<a href="' . get_tag_link($e->term_id) . '">' . $e->name . '</a>'; if($e != end($t)) { $psc_tags .= ', '; } } return $psc_tags; } add_shortcode( 'psc_page_tags', 'psc_pagetags' );By using the shortcode [psc_page_tags] you will get a comma delimited list of linked tags for the current post.
Cheers,
November 4, 2014 at 6:39 pm #346000 -
AuthorPosts
- The topic ‘Portfolio Items tags?’ is closed to new replies.
