views:

13

answers:

1

Hi everyone,

I've been working with WordPress built-in functions for a couple of days now and got everything working this far. However, I am trying to find a solution to only fetch posts that have thumbnails into an array/object.

I have already checked out the Wordpress function references, but have yet not found any solution. How can I achieve this?

A: 

The Wordpress codex is pretty sparse on this topic. In WordPress 2.9, "Post Thumbnails" were added. In 3.0, they seem to have been renamed "Featured Images." In your theme, you can easily check to see whether or not a post has a featured image.

Within the main have_posts() loop in your theme, you can:

<?php
    if (has_post_thumbnail()) {
        /* Post has a thumbnail */
    }
?>
greg