-
-
Save esedic/9e4aea458530a530e09ef5c649e51d08 to your computer and use it in GitHub Desktop.
A standard WP_Query loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = [ | |
// parameters go here | |
]; | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) { | |
while ( $query->have_posts() ) { | |
$query->the_post(); | |
// display the post | |
the_title(); | |
the_content(); | |
} | |
wp_reset_postdata(); | |
} else { | |
echo "no posts were found"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment