• Resolved robs23

    (@robs23)


    Hi,
    I have a ‘foto’ field in my block that is of type Image. This is the main image of the post, the one that should be kind of a thumbnail of the post. Now I noticed that WP has similiar field – featured image. I was wondering if I can set my block somehow so the image that’s selected in ‘foto’ field would automatically become post’s featured image? I wouldn’t like the user that is creating post to select the image twice (1. ‘foto’ field, 2. Featured Image) as it’s repetitive action.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @robs23,
    Thanks for asking, that’s interesting.

    Could the block template use get_the_post_thumbnail() to get the thumbnail?

    Maybe I’m not understanding the use case.

    Hi guyz,

    I got kind of the same interrogation.

    I’m creating a post page, and add some photos (*the only ones in the post) via a blocklab block.

    I’d like that the first img of the post become automatically the post featured image. (so you don’t need to set manually a featured image each time)

    I tried this snippet wich works fine with a basic post (gavick.com) but I think that, as images added via blocklab are not linked (attached) to the post, this function don’t retrieve it.

    I was wondering if there’s a way to get the first image appearing on a post page (maybe by getting the first img tag of the post) and then assign it as featured image of this post… Maybe this could be a solution, I don’t know.

    Bye.

    PS : If what I ask for is impossible, getting get_the_post_thumbnail via a blockfield could be, indeed, a solution

    • This reply was modified 4 years, 9 months ago by jasujs.
    • This reply was modified 4 years, 9 months ago by jasujs.
    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @jasujs,

    I was wondering if there’s a way to get the first image appearing on a post page (maybe by getting the first img tag of the post) and then assign it as featured image of this post… Maybe this could be a solution, I don’t know.

    Sorry, I can’t think of a good way to do that.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Featured image’ is closed to new replies.