Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How can I grab the Featured Thumbnail attached to the Blog page?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42473
    noahgelman
    Participant

    I have a static home page and another page for my blog. Every time I try to grab the thumbnail I’ve attached to the Blog page itself it just grabs the one from the first post.

    #123321
    chrisburton
    Participant

    You need to set a query to get the thumbnails for each post.

    #123481
    noahgelman
    Participant

    I’m not trying to get the thumbnails for each post. I am only trying to get the thumbnail for the current page. On other pages it’s easy, you can just use the_post_thumbnail(), but if you use that on the blog page, it just grabs the thumbnail of the first post (even if I call it before the loop).

    #123490
    begetolo
    Participant

    From the codex:

    This tag must be used within The Loop. Use get_the_post_thumbnail($id, $size, $attr ) instead to get the featured image for any post.

    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

    #123494
    chrisburton
    Participant

    I think get_attachment is another.

    #123511
    noahgelman
    Participant

    @begetolo, I’m NOT trying to get the thumbnail from a POST. I’m trying to get the thumbnail from the current PAGE.


    @chrisburton
    , I’ve tried various get_attachment options and all ended up the same. Any time I try to grab data from the Blog page, it’s just grabbing them from the posts from the loop, even though my code comes before the loop

    #123515
    noahgelman
    Participant

    I’ve figured it out. I get the blog page ID, and then that ID lets me get the proper thumbnail.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.