Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 3

    I would like to be able to display this list of tags with their respective links somewhere within the page.

    Thanks.

    #344935

    Hi 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!
    Elliott

    #345032
    This reply has been marked as private.
    #345704

    Hi!

    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!
    Ismael

    #345726

    Thank 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,

    #346000

    Hey!

    Thank you for sharing your solution!

    Cheers!
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Portfolio Items tags?’ is closed to new replies.