2014年5月29日 星期四

TAG

物件裡的TAG
<?php
          $posttags = get_the_tags();
          if ($posttags) {
            foreach($posttags as $tag) {
              echo $tag->name . ' ';
            }
          }
         ?>

列出所有TAG
<?php
$tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<li class="name ">' . $tag->name.'</li> ';
}
}
?>

沒有留言:

張貼留言