• Resolved Jeylenz

    (@jeylenz)


    Hi JS,

    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 $content was 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.
    Thanks,
    J.

    https://www.ads-software.com/extend/plugins/nextgen-facebook/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author JS Morisset

    (@jsmoriss)

    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?

    Thanks,

    js.

    Thread Starter Jeylenz

    (@jeylenz)

    Ok, done..

    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..

    Cheers,
    J.

    Plugin Author JS Morisset

    (@jsmoriss)

    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?

    Thanks,

    js.

    Plugin Author JS Morisset

    (@jsmoriss)

    Thread Starter Jeylenz

    (@jeylenz)

    I did re-download, now re-re-downloaded and re-re-installed! Should be ok!

    Plugin Author JS Morisset

    (@jsmoriss)

    Ok, got it.

    It turns out WP builds the attachment <img/> HTML as part of the template, so there’s no $post->post_content to 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.

    Thread Starter Jeylenz

    (@jeylenz)

    Thanks Js, that was fast! I was just starting to play with wp_get_attachment_image_src
    (which avoid the use of regex) but your fix works perfectly!

    Plugin Author JS Morisset

    (@jsmoriss)

    Ack! I didn’t see that function! Ok, hold on… ??

    js.

    Plugin Author JS Morisset

    (@jsmoriss)

    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. ??

    Thanks,

    js.

    Thread Starter Jeylenz

    (@jeylenz)

    Ok, it’s still working perfectly!
    Cheers,
    J.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Default thumbnail for the attachment page’ is closed to new replies.