function hashtags(){
$tags = get_the_tags($post->ID);
$count=0;
foreach ($tags as $tag){
$count++;
if (1 == $count) {
return $tag->name . ', ';
}
if (2 == $count) {
return $tag->name . ', ';
}
if (3 == $count) {
return $tag->name;
}
}
}
I don't know about php, i'm noob, i made this function for showing the name of the first 3 tags of post, i want this return: tag1, tag2, tag3.
The function works but only return the first tag, if i put echo no problem but i don't want an echo, any idea?