开发者

Showing tags in wordpress without link

开发者 https://www.devze.com 2022-12-29 17:36 出处:网络
I would like to show a list of tags on a post but without a link on the tag. Right now I use: <?php the_tags( \'<li>\', \', \', \'</li&开发者_StackOverflowgt;\'); ?>

I would like to show a list of tags on a post but without a link on the tag. Right now I use:

<?php the_tags( '<li>', ', ', '</li&开发者_StackOverflowgt;'); ?>

How do I strip the link from the tag?


From the Wordpress Codex:

<?php
  $posttags = get_the_tags();
  if ($posttags) {
    foreach($posttags as $tag) {
      echo $tag->name . ' '; 
    }
  }
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号