Display only the last post with image attached to it
I´m fairly new to WP and I came up with a problem I couln´t find a exactly solution for.
I have a website with a WP blog running on it. I need that on index page the WP loop displays only the latest post with a thumb/image attached to it.
Why? Because if it shows a post without the thumb my layout gets broken.
I´m using “$posts = get_posts(‘numberposts=1’);” but it displays all the posts with or without child.
- The topic ‘Display only the last post with image attached to it’ is closed to new replies.