Get First Tag Only?
-
I have this code, which posts all of my tags, unlinked, separated by a comma.
<?php $posttags = wp_get_post_terms( get_the_ID() , 'post_tag' , 'fields=names' ); if( $posttags ) echo implode( ', ' , $posttags ); ?>
Is there any way to just post the first tag?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get First Tag Only?’ is closed to new replies.