wp_query class wordpress code example
Example: wp query
have_posts() ) {
echo '';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '- ' . get_the_title() . '
';
}
echo '
';
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();