- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Germany
- Has been a member for 3-4 years
- Interviewed on the Envato Notes blog
- Item was Featured
Heyall,
here it goes:
<?php $posttags = get_the_tags();
$count=0;
if ($posttags)
{
foreach($posttags as $tag)
{
$count++;
if ($count <= 3)
{
echo $tag ?> name . ', ';
}
if ($count == 3)
{
echo $tag -> name . '..';
}
}
}
?>
But it does not fully work. What I attempted with the ==3 part was to add a ’...’ after the third tag. Any ideas?
Thanks 
Heyall,Try this…
here it goes: I have this:
<?php $posttags = get_the_tags(); $count=0; if ($posttags) { foreach($posttags as $tag) { $count++; if ($count <= 3) { echo $tag ?> name . ', '; } if ($count == 3) { echo $tag -> name . '..'; } } } ?>But it does not fully work. What I attempted with the ==3 part was to add a ’...’ after the third tag. Any ideas?
Thanks![]()
if ($count < 3)
{
echo $tag ?> name . ', ';
}
if ($count == 3)
{
echo $tag -> name . '..';
}
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Germany
- Has been a member for 3-4 years
- Interviewed on the Envato Notes blog
- Item was Featured
Thanks mate, it did work.
May I ask you, if there’s a hack to individualize tags called from get_the_tags.
I have the code above (with the fixed solution you provided). I would like each tag to be a single tag in style (so that I can apply a :hover state which only applies to ONE of the tags, and not the whole group.
Any ideas?
Thanks again
!
