WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Photoblog
How to use common wordpress thumnail ? the_post_thumbnail (10 posts)

  1. Laurent J.V. Dubois
    Member
    Posted 3 years ago #

    Several plugins use the new common wordpress thumnail.
    ( like wpbook that help me to generate facebook fan page for this blog)

    YAPB use this own attachment system.
    I'm not an expert, so my question is to understand is that will be possible to create a plugin or to add a function that test the existence of an existing thumbnail in the post

    Something like testing with has_post_thumbnail()
    and to use the wp_insert_attachment() function ?

    The goal will be to take advantage of existing functions and plugins around common wordpress thumnails

    thanks for your feedbacks

  2. stvwlf
    Member
    Posted 3 years ago #

  3. Laurent J.V. Dubois
    Member
    Posted 3 years ago #

    Thanks , but that don't help me a lot about the better strategy to use ...

  4. nigelt74
    Member
    Posted 3 years ago #

    Hi Ljvd

    Not sure if you solved it, but this is what i did, spent way to long on it today, you just have to be sure you have set a featured image on each post or page if you want the image to display

    This is the contents of my yafpp.php
    note that i have change the list to divs, you may want to change that back

    [Code moderated as per the Forum Rules. Please use the pastebin]

  5. Laurent J.V. Dubois
    Member
    Posted 2 years ago #

    Hi Nigel,

    I've just find your answer today.
    Your code have been removed by a moderator :-/

    Should you share your file yafpp.php on pastebin like suggested by a moderator, for the advantage of the community.
    Or by email to linkedin[AT]ljvd(dot)com

    Thanks,
    Laurent (who now subscribe to the thread)

  6. stevland
    Member
    Posted 2 years ago #

    Hey Nigel,

    That code would be very handy, if you care to share the effort you put into it.

    (subscribed)

  7. nigelt74
    Member
    Posted 2 years ago #

    Ok the site I did that for didn't go ahead, I think this is the code, if not let me know and I will see if I can find a backup version of the code somewhere.

    http://pastebin.com/y3wvmMBe

    Note this was adapted for my project it may not work for you, BUT you must set a featured image for each post

  8. jaroat
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Laurent -

    If i find adequate wordpress hooks i could try to deliver an YAPB-Thumbnail via has_post_thumbnail(), the_post_thumbnail() and get_post_thumbnail().

    An general goal for the future is to replace the custom table and to save YAPB-Images as normal WP-Images or custom post types. That would additionally allow to add more than one image - but that's really future talk.

    I'll have a look what if anything can be done for you with the post_thumbnail-functions.

    br from Salzburg,

    - Johannes

  9. Laurent J.V. Dubois
    Member
    Posted 2 years ago #

    Thanks for this feedback Johannes.
    I've shortly badly hooked the wpbook plugin for my need.
    So don't lost your time to research a solution for me.

    This announced future of YAPB is a pretty good news,
    I'm pretty busy currently, but will be happy to translate the next version, my french is better than my english ;-)

  10. jaroat
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Laurent -

    Sorry, but i've bad news: i don't find a way to hook cleanly into the get_post_thumbnail_id() function - And the base themes 'twentyten' and 'twentyeleven' both rely on this function.

    So this feature will really have to wait until i implement the WordPress-compatible saving of YAPB-images in the posts-table.

    br from Salzburg,

    - johannes

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic