- This topic is empty.
February 4, 2013 at 4:27 pm #42473
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.February 4, 2013 at 4:47 pm #123321chrisburtonParticipant
You need to set a query to get the thumbnails for each post.February 5, 2013 at 3:09 pm #123481
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).February 5, 2013 at 4:07 pm #123490begetoloParticipant
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.February 5, 2013 at 4:26 pm #123494chrisburtonParticipant
I think get_attachment is another.February 5, 2013 at 6:22 pm #123511
@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 loopFebruary 5, 2013 at 7:41 pm #123515
I’ve figured it out. I get the blog page ID, and then that ID lets me get the proper thumbnail.
- You must be logged in to reply to this topic.