我正在使用此代碼在WP博客文章的末尾添加標簽: 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' );但我想插入一個圖像而不是“標簽:”這個詞,這可能嗎?
1 回答

慕桂英546537
TA貢獻1848條經驗 獲得超10個贊
嘗試以這種方式更改行:
$content .= '<img src="path.jpg"> ' . implode(', ', $array) . '<br>';
- 1 回答
- 0 關注
- 151 瀏覽
添加回答
舉報
0/150
提交
取消