I need to import a WordPress eXtended RSS file generated by old WordPress site in a new website but missing img thumbnail in RSS file.
Hi unicaweb!
Please add the following to your functions.php file
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');
please let us know if you need anything else
Regards,
Basilis
Yes but this code add to function.php of my old theme or in my new enfold theme ?
Hi,
I need to import a WordPress eXtended RSS file generated by old WordPress site in a new website but missing img thumbnail in RSS file.
Are you trying to move posts from an old site to the new one? This link should help: https://codex.wordpress.org/Importing_Content
Best regards,
Ismael
Do not work
Hi,
Sorry but I’m not sure what you mean by that, what exactly is not working?
Regards,
Rikard
I have esxported RSS file from old WordPress ( http://www.mylabrador.it/ ) but when I install it in a new enfold installation under a subfolder ( http://www.mylabrador.it/nuovo/ ) the thumbnails are missing