Getting posts without thumbnail
-
Hello! Hope you’re fine! Have a little WordPress-wondering, which I would some help with! I just wonder how to get the post which not have a thumbnail connected to the post. When there is a post wihtout thumbnail, I want to show the title and text for the post instead of the picture. Someone who know how to do this?
Thanks for all help, and if I forgot to tell you some information, please tell me, and I will give you the missing information. (And please sorry for my bad english!)
The code, which getting the “thumbnail”:
<?php $postPosts = new WP_Query(); $postPosts->query(''); ?> <?php while ($postPosts->have_posts()) : $postPosts->the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="thumbnail"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> </div> </div> <?php endwhile; ?>
Take care!
Sincerly!
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Getting posts without thumbnail’ is closed to new replies.