I have added a function to functions.php on my theme.
function insertAds($content) {
$content = $content.' add goes here';
return $content;}
add_filter('the_content_feed', 'insertAds');
add_filter('the_excerpt_rss', 'insertAds');
The problem is that I’m having the add displayed under each content, and not at the end of the rss page. How can I fix that?
WordPress doesnât offer a hook for what you want to do. In which element would you place the ad?
The usual RSS-2-Feed has meta data and items (the content). There is no other element.
See
wp-includes/feed-rss2.php
for details.Update
Adjust the following code to your needs and put the file into your plugin directory:
Is this the effect you had in mind? As you can see, adding content is rather easy. 🙂