Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How to include Related Posts in WP RSS feed not use plugin? I have search around on google and stackexchange but have no result about this. Thanks all friends!

share|improve this question
    
Do you mean how to compute related posts or how to place them in feed when they are already computed? –  Krzysiek Dróżdż Jun 20 '13 at 8:01
    
Yes! I want to place them in feed. –  Zen Nguyễn Jun 20 '13 at 16:48
add comment

1 Answer 1

up vote 0 down vote accepted

You have to use the_content and the_excerpt_rss hooks. You can do this like this:

function rss_append_footer($content) {
    if(is_feed()) {
        $related_posts_html = ...  // I assume you already can compute it
        $content .= $related_posts_html;
    }
    return $content;
}

add_filter('the_content', 'rss_append_footer');
add_filter('the_excerpt_rss', 'rss_append_footer');
share|improve this answer
    
Thank you very much @Krzysiek Dróżdż. –  Zen Nguyễn Jun 21 '13 at 2:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.