The post Thumbnail
-
Hello, im trying to make a custom image slider,i made a front page.php and try to generate some post feature image with a WP_Query.But the code only generates one, with the post title it works great.here is the code:
<?php $args=array( 'posts_per_page'=>3 ); // The Query $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { echo '<ul>'; while ( $the_query->have_posts() ) { $the_query->the_post(); if ( has_post_thumbnail() ) { the_post_thumbnail(); } } /* Restore original Post Data */ wp_reset_postdata(); } else { // no posts found } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘The post Thumbnail’ is closed to new replies.