Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1021833

    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.

    #1021981

    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

    #1022240

    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.

    #1022804

    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

    #1022813

    Thank you Nikko!
    The login credentials are listed in the private content.

    #1022894

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.