[Support request] Filter function for post thumbnail

Home Forums Support [Support request] Filter function for post thumbnail

Home Forums Support Filter function for post thumbnail

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #230436
    Caro

    Hi!

    I’m trying to change the image wich is shown on the homepage, but only for the first post.
    I want to change it from the thumbnail to the first image of the post.
    What is the right function I can add a filter to?

    I already tried ‘get_post_thumbnail’, but that didn’t work.

    Thanks in advance!

    #230493
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I’m not sure if there is such a filter for something like that.

    Are you wanting to do it automatically for the latest posts? Or is it just this one specific post?

    #230571
    Caro

    Hi Tom!

    It should work automatically.
    I’m not looking for a filter specifically for the first thumbnail on the homepage, but a filter for the thumbnail in general. Then I could limit my changes to this specific thumbnail via php.
    Do you understand what I mean? 😉

    #230773
    Tom
    Lead Developer
    Lead Developer

    You can find the function for the featured image here: https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/

    You might be able to use the post_thumbnail_html filter, but I’m not sure. Stack Overflow might be the best place to ask.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.