Answer the question
In order to leave comments, you need to log in
Why doesn't the parser copy title photos from the article?
There is a parser plugin for WordPress. Parses articles from websites via rss. There are no problems with the content of the article. And with title photos, the bottom line is that there are no title photos on the rss page. I thought to solve this problem in the following way. The item tag has a link tag that is a link to each article, and I would like to make the parser for each article follow this link and copy the photo from the featured-image block. I just don't know how to implement it. Link to rss - merezha.co/feed
Here is the plugin configuration code:
if($blog_enc != $src_enc){
$content = mb_convert_encoding($content, $blog_enc, $src_enc);
$title = mb_convert_encoding($title, $blog_enc, $src_enc);
}
$res .= $pr->set_title($title); //Заголовок материала
$res .= $content.$attachments; //Основной текст материала
$content = str_replace("://://","",$content);
$content = str_replace("/wp-content/","http://merezha.co/wp-content/",$content);
$content = $pr->process_images($content); //Закачиваем картинки
$data = file_get_contents($link);
$str = $pr->cut_str($data,'<div class = "featured-image">',"</div>");
if($str!="") $content .= $str;
Answer the question
In order to leave comments, you need to log in
Have you even looked at xml(rss)? As if there are pictures:
<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2018/08/aabbf793e4e20e7ea34bebd0c8de2b2e.jpg" class="insidewpg"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question