WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Facebook: Advanced Sharing Optimization for All Social Websites
[resolved] Default thumbnail for the attachment page (11 posts)

  1. Jeylenz
    Member
    Posted 1 year ago #

    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.

    http://wordpress.org/extend/plugins/nextgen-facebook/

  2. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. Jeylenz
    Member
    Posted 1 year ago #

    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.

  4. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

  6. Jeylenz
    Member
    Posted 1 year ago #

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

  7. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  8. Jeylenz
    Member
    Posted 1 year ago #

    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!

  9. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    Ack! I didn't see that function! Ok, hold on... :)

    js.

  10. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  11. Jeylenz
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic