正确代码:
function tags_after_single_post_content($content) {
  $posttags = get_the_tags();
  if ($posttags) {
    $array = [];
    foreach($posttags as $tag) {
      $array[] = \'<a href="/tag/\' . $tag->slug . \'/">\' . $tag->name . \'</a>\';
    }
    $content .= \'Tags: \' . implode(\', \', $array) . \'<br>\';
  }
  return $content;
}
add_filter( \'the_content\', \'tags_after_single_post_content\' );
 原因
this 答案是错误的,因为
the_tags 应在内部使用is
The Loop \\u标记不返回任何内容,因此其他代码不执行任何操作。在这个答案中
get_the_tags 返回标记实例的数组,以便我们可以将它们附加到内容中。