In WordPress 3 there is Featured Image functionality. How do i fetch all posts that have a featured image with them? Here is my current custom loop:
$loop = new WP_Query( array( 'posts_per_page' => 15 ) );
How to query posts for a custom post type in a custom taxonomy ? in wordpress 3.0
1:Why my wordpress plugin settings shows up for users other than administrator?
This should work:. Is there a way to redirect users who are not administrator from WordPress wp-admin?Wordpress cron problemsmost stable / useful way to blog in Magento
I haven't tested this, though. Custom image upload field in WordPressAlso, this will probably fetch all posts and pages. very odd 404 on wp-admin directoryUse
$loop = new WP_Query( array( 'posts_per_page' => -1, 'meta_key' => '_thumbnail_id' ) );
'post_type' => 'post'to limit it to blog posts.. Data Export
I don't believe you need any special loops defined for this to work.. Though you did need to add any small snippets into your functions.php. like this one:.
after apply the above code to functions.php file, your theme will support Featured Images and you will see a new link @ the bottom right of your Post Add / Edit interface.. This guide will guidance you, if you are looking for more info regarding this : How to Use Wordpress Featured Image Feature.
<?php add_theme_support ( 'post-thumbnails' ); ?>