Ok, I’ve created some sort of solution…
I’ve used this code to create a custom RSS feed:
https://xplus3.net/2008/10/30/custom-feeds-in-wordpress/
After that, I made a feed distinction for posts/comments
function myPlugin_create_feed() {
//header('Content-type: text/xml');
if(is_single()) {
include('my_comments_feed.php');
} else {
include('my_feed.php');
}
}
Fot my_comments_feed.php I copy-pasted the standard RSS2 Feed Template, but it still only showed the default number of items. So I changed the code, beginning at line 34:
<?php do_action('commentsrss2_head'); ?>
<?php
if(is_single()) {
// activate custom query:
global $post, $wp_query;
$wp_query->comments = get_comments( array(
'post_id' => $post->ID,
'status' => 'approve',
'type' => 'comment'
) );
}
$results = $wp_query->comments;
foreach ($results as $result) {
//echo $result->comment_author . "<br>\n";
$mycomment_author = apply_filters('comment_author_rss', $result->comment_author);
$mycomment_time = mysql2date('Y-m-d H:i:s', $result->comment_date_gmt, false);
$mycomment_text = apply_filters('comment_text', $result->comment_content);
$mycomment_text_rss = apply_filters('comment_text_rss', $result->comment_content);
$mycomment_link = esc_url( apply_filters('the_permalink_rss', get_permalink() )) . "#comment-" . $result->comment_ID;
echo " <item>\n";
echo " <title>". $mycomment_author . "</title>\n";
echo " <link>" . $mycomment_link . "</link>\n";
echo " <dc:creator>" . $mycomment_author . "</dc:creator>\n";
echo " <pubDate>". mysql2date('D, d M Y H:i:s +0000', $mycomment_time, false) . "</pubDate>\n";
echo " <guid isPermaLink=\"false\">" . get_comment_guid($result->comment_ID) . "</guid>\n";
echo " <description>" . $mycomment_text_rss . "</description>\n";
echo " <content:encoded><![CDATA[" . $mycomment_text . "]]></content:encoded>\n";
echo " </item>\n";
}
?>
</channel>
</rss>
There might be a simpler solution, but this seems to work!