Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
garfieldx
tagDiv Member

Hi Lucian,

very cool! Worked for me! I extended it a little bit, that it can use more than one tag and does not appear at all, if there is none:


$post_tags = get_the_tags();
$tags_filter = '';
		
if ($post_tags)
{
  for($i=0;$i<count(array_values($post_tags));$i++)
  {
    $tags_filter .= array_values($post_tags)[$i]->slug.',';
  }
			
  $tags_filter = substr($tags_filter,0,-1);
  echo do_shortcode('[td_block4 tag_slug=' . '"' . $tags_filter . '"' . ' limit="5" custom_title="'Related Posts'"]');
}

Thanks for your help!

BR, Claudio

garfieldx
tagDiv Member

Hi,

I would also like this feature. Totally makes sense.

I had the same issue in Block 4. I put the recommended code after the foreach loop in the inner() function.


....
foreach ($posts as $post) {
   if(!is_single($post->ID)) {

   ....

   }

BR, Claudio

Viewing 2 posts - 1 through 2 (of 2 total)