More tag in RSS feed for WordPress

Status
Not open for further replies.

Melder

Active Member
139
2011
35
0
Recently, i noticed that my RSS feeds were leeched by many sites, an ip ban would have been enough but not for feedburner.

Here is another solution to keep your links safe with wordpress:

Add these lines in your functions.php file (in /wp-content/themes/yourtheme/functions.php) :

PHP:
function mytheme_content_feed($feed_type = null) {
    if ( !$feed_type )
        $feed_type = get_default_feed();

    global $more;
    $more_restore = $more;
    $more = 0;
    $content = apply_filters('the_content', get_the_content('Read more on yoursite.com'));
    $more = $more_restore;
    $content = str_replace(']]>', ']]>', $content);
    return $content;
}
add_filter('the_content_feed', 'mytheme_content_feed');
Enjoy!

Source: http://wordpress.org/support/topic/rss-feed-before-the-more-tag
 
Last edited:
Status
Not open for further replies.
Back
Top