E
E
Eduard Valeev2016-12-23 19:19:05
RSS
Eduard Valeev, 2016-12-23 19:19:05

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
c8f4aec94c5346038e207d0a36cab36f.jpg
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:
03c74a0f97ad4ca8ab3668db51152a62.jpg
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');

but even commenting it out - the problem did not disappear.
I have tried completely disabling all plugins. checked after that - the problem did not disappear.
I suppose that most likely there may be some kind of hook to which you can feed the rss feed before the output, which, in turn, will return the supplemented (or rather corrected) rss to the client. But where to get it from or how to write it myself - I do not know.
I can't figure out how. Helpmi, dear All.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eduard Valeev, 2016-12-23
@Adward

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 question

Ask a Question

731 491 924 answers to any question