Answer the question
In order to leave comments, you need to log in
How to intercept and reparse rss in wordpress?
A couple of spaces (or even three) have crept into my rss feed on my site (at the very beginning, a line feed): tatar-congress.org/ru/feed
Because of this, some translators on the social network do not accept such a file. Browsers Opera and Safari "normally eat" such a stream. IE swears:
Edge is trying to download this file. Chrome opens no matter what. Translator novapress.com does not accept and does not swear. Their support offers to find a programmer....
I've already rummaged through everything I could, what I knew and didn't know... I can't find a problem.
I would like to ask if there are any alternative ways to give an rss feed (any hooks there, for example, or filters).
By the way, I used the following piece of code in functions.php, which sticks thumbnails to posts and clears post content from nested galleries:
function thumbs_in_rss($content) {
global $post;
if(has_post_thumbnail($post->ID)){
$thumb = get_the_post_thumbnail( $post->ID, 'full' );
$content = preg_replace("/<img[^>]+\>/i", "", $content);
$content = $thumb . $content;
}
//return $content;
return mb_convert_encoding($content, 'utf-8', mb_detect_encoding($content));
}
add_filter('the_excerpt_rss', 'thumbs_in_rss');
add_filter('the_content_feed', 'thumbs_in_rss');
Answer the question
In order to leave comments, you need to log in
Question removed.
It turns out that the whole point is that in one of the included (via functions.php) files there were a couple of card transfers between php blocks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question