Hi,
I wonder if I understand the loop well. I got this code, and I wonder if it is ok if I don't put a endwhile?
<?php
$args = array (
'post_type' => 'offresdemploi',
'posts_per_page' => '3',
'order' => 'DESC',
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) { while ( $query->have_posts() ) {
$query->the_post(); ?>
<li>
Content...
</li>
<?php }
} else {
}
wp_reset_postdata(); ?>
Does the wp_reset_postdata do the job by stopping the loop?