[SOLVED] Help using the_post_thumbnail
Hi all,
I am trying to set up a bit of code to show the latest post excerpt from a particular category. I want the post thumbnail to display if it is present in that post, and if not I want a default image to show. I am using this: Code:
<?php global $post; |
I'm not sure where you are placing that code but I would use the List Category Posts Plugin for what you are trying to do and the Feaured Image function works fine.
|
I am putting this in style and edit center column. I was hoping I could achieve it without using any more plugins as my site is starting to get a bit bloated with them.
So it sounds like featured image is what I need to choose the thumbnail, so there must be a problem with my code. I wonder if I actually need to specify which post has the thumbnail in my if statement? But that would make the whole thing pretty redundant. |
Solved - I needed to add this: setup_postdata($post);
So the whole thing now reads Code:
<?php global $post; |
All times are GMT -6. The time now is 04:57 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.