私はwordpressのデフォルトのRSSフィードに広告を挿入することに関していくつかの助けを見つけたいと思います(私はfeedburnerを使用しません)
<?php
function insertAds($content) {
$content = $content.'<hr /><a href="http://www.wprecipes.com">Have you visited WpRecipes today?</a><hr />';
return $content;
}
add_filter('the_excerpt_rss', 'insertAds');
add_filter('the_content_rss', 'insertAds');
?>
しかし、私はthe_excerpt_rssとthe_content_rssが非推奨のようなものであることを読みました。現在のフックについて誰かが私にアドバイスすることはできますか?
ありがとう
The_content_rssの代わりに the_content_feed をご覧ください。
これらのフィルタは非推奨ではありません。それらはwp-includes/default-filters.php
でも使われています。
しかし、あなたは あなたの関数名の前に を付けるべきです。