Hi Simon, yes in those examples you see in my blog thumbnails display id 2 mostly because it’s my blog in english which is the one with most recent content to show, but if you check images here: NLPosts CSS each thumbnail is pulled from their own blog id, (2 english, 5 spanish).
I was digging a little bit about this issue and found this: MULTISITE not defined. Apparently people who upgraded “jumping” two or more versions were having issues with file paths.
Just wondering if this is your case, the problem I see with your hack if implemented, is for those of us who have a blog id 2 will see it stripped out which will result in missing images.
I would suggest you to try one of these plugins: Thumbnail sizing this topic was opened for thumbnail sizes, but I think it would help you to regenerate all thumbnail images and hopefully fix their paths.
As I told you before, I don’t believe this is a bug in NLPosts but an issue with your WordPress installation or maybe upgrading history. I will explain the reasons why I believe so:
Network Latest Posts uses this hook to pull thumbnails:
// Get the thumbnail
$thumb_html = get_the_post_thumbnail($field->ID,$thumbnail_size,array('class' =>$thumbnail_class));
// If there is a thumbnail
if( !empty($thumb_html) ) {
// Display the thumbnail
echo "<a href='".$all_permalinks[$field->guid]."'>$thumb_html</a>";
}
Where $field->ID
is the post’s ID, considering your post titles and other links are pointing to the right article, it’s impossible NLPosts is taking the wrong $field->ID number, otherwise it would be reflected in wrong links everywhere. So this take us to the thumbnails paths stored into the database.
If you use that hook manually in a test page, get_the_post_thumbnail(post_id_here)
you can see what’s being pulled out. Of course it must be used in a file within the blog you want to test.
get_the_post_thumbnails
will pull information related to attachments for a specific post ID, NLPosts doesn’t interfere with this hook, it doesn’t change URLs or paths anywhere, it just pulls out paths already stored when those images were added to the post and were created by WordPress attachment functions.
As for blog IDs they’re pulled from wp_blogs table, and as stated before, your posts are being correctly extracted and links are working ok so it can’t be a problem with incorrect blog IDs. So thumbnails issues must be being caused by a malfunction somewhere in your blogs mostly related to thumbnails generation.
If you try one of those plugins to regenerate thumbnails, let me know if that worked for you.
P.S: I forgot to mention this topic problem thumbnails someone else had issues with thumbnails using NLPosts but those problems were related to external plugins, and NLPosts v3 doesn’t use the same code to display thumbnails anymore.
I hope this helps you find out what’s going on.
Kind regards.