Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1001648

    HI
    I am trying to get my portfolio tags to automatically show on the bottom of all my portfolio items, made in the advanced editor. I followed this thread (https://kriesi.at/support/topic/portfolio-items-tags/#post-345704) which puts the tags at the top of the page, and although the link urls seem to be correct, none of the portfolio items show up on the linked pages.

    Can you see what’s wrong? This is the code I have in the functions.php of my child theme to show the portfolio tags:

    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;
    }

    thanks for your help,
    Nancy

    #1001702

    Hey Munford,

    Which version of php are you running?

    Best regards,
    Victoria

    #1001738

    Hi Victoria
    thanks for looking (again) at this issue. I started a new thread since I am using a different code now. I am running php 7.1.

    Nancy

    • This reply was modified 6 years, 2 months ago by Munford.
    #1001747

    Hi,

    This is a bug of the local seo plugin (see https://kriesi.at/support/topic/tag-pages-posts-nothing-found/ ). I fixed it on your website too.

    Best regards,
    Dude

    #1001760

    Hi Dude,
    Great! Thanks very much! That works fine.
    Can anyone help me to move the tags to the bottom, or underneath, the trip info, instead of them displaying at the top?
    thanks for your help
    Nancy

    #1001776

    Hi,

    I replaced your code with this function to solve the issue:

    
    add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 999, 1);
    function avia_add_social_toolbar_template_builder($content = "")
    {	
    	if(is_singular('portfolio'))
    	{
    		$posttags = get_the_tags();
    		if ($posttags) 
    		{
    			$content .= '<span class="blog-tags minor-meta"><strong>'.__('Tags:','avia_framework').'</strong><span> ';
    
    			$numItems = count($posttags);
    			$i = 0;
    
    			foreach($posttags as $key=>$tag) 
    			{
    				if(++$i === $numItems) 
    				{
    					$content .= '<a href="'.get_tag_link($tag->term_id).'">'. $tag->name .'</a>';
      				}
    				else
    				{
    					$content .= '<a href="'.get_tag_link($tag->term_id).'">'. $tag->name .'</a>, ';
    				}
    		  	}
    			$content .= '</span></span>';
    		}
    	}
    
    	return $content;
    }
    

    Best regards,
    Dude

    #1001852

    Hey Dude
    your magic code worked! Have no idea what it’s about but thanks so much.
    Working just great now – you can close this thread.

    you rock
    Nancy

    #1001859

    Hi,

    Great, glad we could help you :)

    Best regards,
    Dude

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Portfolio tags linking error, tag placement’ is closed to new replies.