0

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!

  • 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
0

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');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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