[Resolved] Default thumbnail for the attachment page
For some reason, the code cannot find my image on the attachment pages
(eg. here) (ideally it should get the corresponding thumbnail right ?)
In the debug info i have
get_content_images_og() : no <img src=””> tag found
and a fallback to the default image.
I suspected that the
$contentwas not correct but couldn’t debug it further. Do you have any clue on how to fix this ?
I tried the regular and dev versions of the plugin.
Yeah, this looks to be the problem:
apply_content_filter() : content strlen() before = 0, after = 0
It appears that $post->post_content might be empty. I’ve added an additional debug msg to the DEV version to make sure. Could you download and install the DEV version again?
I was suspecting some kind of priority problem (the content would not yet exist when the function is called) and blindly tried to increase NGFB_OG_PRIORITY … without success..
Hm. Did you re-download a new DEV version? The changes I made aren’t showing… Maybe you were too quick for me. 😉 Would you mind downloading and installing the latest DEV version again?
Link to the DEV version: http://downloads.wordpress.org/plugin/nextgen-facebook.zip
I did re-download, now re-re-downloaded and re-re-installed! Should be ok!
Ok, got it.
It turns out WP builds the attachment
<img/>HTML as part of the template, so there’s no
$post->post_contentto use. I had to add some code specifically for attachment pages (and their images).
Re-re-re-download and install the latest DEV version – it should work fine now. 😉
Thanks Js, that was fast! I was just starting to play with
(which avoid the use of regex) but your fix works perfectly!
Ack! I didn’t see that function! Ok, hold on… 🙂
Ok, would you mind downloading and installing the latest DEV version again? The
wp_get_attachment_image_src()function allowed me to simplify the code a bit. 😉
- The topic ‘[Resolved] Default thumbnail for the attachment page’ is closed to new replies.