0
以下のコードは、自分のwordpress RSSフィードに画像を追加します。私はイメージを自動的に対応する投稿にハイパーリンクさせるようにしたいと思っています。コードは、私のテーマののfunctions.phpであるWPパーマリンクをPHPに追加する
function wcs_post_thumbnails_in_feeds($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = get_the_post_thumbnail($post->ID) . '<span class="text">' . $content . '</span>';
}
return $content;
}
add_filter('the_excerpt_rss', 'wcs_post_thumbnails_in_feeds');
add_filter('the_content_feed', 'wcs_post_thumbnails_in_feeds');
Can I change this so that the post_thumbnail is automatically wrapped with a link to the post?
どのように私はget_the_post_thumbnail($ポスト> ID)リンクを使用してコードの一部を折り返すことができますか?ありがとう
ありがとうございます@ Fencer04 - それは完璧に動作します! :-) – jkendall