16. Mai. 2009
von
Keine Kommentare
Re: how to show only the first tag of a post in WordPress :: Reply by Joern
this code should echo only one (first) tag of a post, you should use it inside the loop or create a loop around this:Code:<?php $mytags = get_the_tags() ; $count=0;if (!empty($mytags)) {foreach($mytags as $tag) { $count++;if (1 == $count) { echo…