Answer the question
In order to leave comments, you need to log in
How to set Woocommerce to include products in RSS when the price changes?
I set up RSS on the site in such a way that, in addition to content, images are also fasted. I share the code with a respected community (suddenly someone will come in handy):
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question