Select pages with featured image with query
-
Hi there,
I am trying to select all pages (or posts) from the database where a featured image (previously called Post Thumbnails) has been added.
However I cannot seem to find the right parameter for this, is it even possible like this? If not, how can I do this differently?
Thanks for the help!
<?php $featured = new WP_Query('post_type=page&orderby=title&order=ASC&post_status=publish'); while ($featured->have_posts()) : $featured->the_post();$do_not_duplicate = $post->ID; echo $post->post_title." - ".wp_get_attachment_url( get_post_thumbnail_id($post->ID) )."<br />"; endwhile; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Select pages with featured image with query’ is closed to new replies.