I had a huge issue with the photo stream not working on the latest WordPress. It just continued to load and no photos displayed. I saw a lot of the same errors when I went to debug the issue. I was able to fix it by doing the following…
all instances of $photo[title] and $photo[id] I changed to $photo[‘title’] and $photo[‘id’]
in addition I had an issue with the image alt text breaking everything. It ended up being an issue caused by the html special characters in the Flickr title. So I added this line of code.
$mytitle = htmlspecialchars($photo['title'], ENT_QUOTES, 'UTF-8');
Then I replaced the alt title with my new variable.
Finally, I am not sure if it was necessary but I set up a variable for my array to use in the function. This is what my code now looks like for lines 183 to 200 of the
flickr-photostream.php file.
$photo_array = $photos['photos']['photo'];
foreach ($photo_array as $photo) {
// print "<div style='position:relative; border:1px solid red; z-index:200;'>" . $photo['title'] . "</div>";
if($lightbox){
$ris .=
'<a href="' . $f->buildPhotoURL($photo, "large") . '" title="' . $photo['title'] . '" >';
}else{
$ris .=
'<a href="' . $photos_url . $photo['id'] . '/in/photostream/lightbox/" target="_blank" title="' . $photo['title'] . '">';
}
$mytitle = htmlspecialchars($photo['title'], ENT_QUOTES, 'UTF-8');
$ris .= '<img alt="' . $mytitle . '" src="' . $f->buildPhotoURL($photo, $imgSize) . '" />'
. '</a>';
}
I hope this helps.