For some reason the following isn't loaded anymore in wordpress 3.5. Does anyone know how to fix the get_the_post_thumbnail() ?

I'm using the follow code:

echo "<div class='meta_apps'>";
echo "<a href='"; the_permalink(); echo "'>";
echo "<div class=\"meta-icon\">".get_the_post_thumbnail($post->post_id, 'thumbnail', $attr)."</div>";
echo "<div class=\"meta-title\">".$post->post_title."</div>";
echo "</a>";
echo "</div>";

2 Answers 2


I could be mistaken, but I don't think $post->post_id works to retrieve the post's ID. I believe you want $post->ID. So that was probably your issue to begin with, though without seeing your $attr array, it's hard to say. Here's a reference for $post's properties. In this case, get_the_post_thumbnail is the more appropriate function.

In your answer you posted for yourself, you're using the_post_thumbnail incorrectly. First off, you don't need to echo it; the_post_thumbnail will output the thumbnail. Side note: Any function in WordPress that starts with the_ is almost always going to output something automatically. Second, You don't need to pass it $post->ID (again, using the wrong property). Third, the first property of the_post_thumbnail is the size, e.g. "thumbnail".

  • Thanks matthew, i'm not a programmer so these kind of basic stuff makes my head spin sometime. Thanks for your answer, it helps alot!
    – rwzdoorn
    Commented Dec 13, 2012 at 10:13

Problem solved,

                echo the_post_thumbnail($post->post_id, array('class' => 'meta_icon')); echo "</div>";

Don't use 'get_the_thumbnail' but simply use the_post_thumbnail.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.