Skip to content

Instantly share code, notes, and snippets.

@tarikcayir
Last active November 6, 2015 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarikcayir/c4ffde26bedd4573ccab to your computer and use it in GitHub Desktop.
Save tarikcayir/c4ffde26bedd4573ccab to your computer and use it in GitHub Desktop.
<?php
// Query args.
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
);
$query = new WP_Query( $args );
// Start the loop.
while ( $query->have_posts() ) : $query->the_post();
if ( !has_post_thumbnail() ) { // check if the post hasn't a Post Thumbnail assigned to it
echo get_the_title().'<br/>';
}
// End the loop.
endwhile;
// Restore original Post Data
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment