Last active
December 21, 2015 03:29
-
-
Save yellowberri-snippets/6242595 to your computer and use it in GitHub Desktop.
PHP: WP: WP_Query
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 = array ( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'status' => 'publish' | |
); | |
$query = new WP_Query( $args ); | |
?> | |
<?php if ($query->have_posts()) : ?> | |
<?php while ( $query->have_posts() ) : $query->the_post(); ?> | |
<?php endwhile; ?> | |
<?php endif; wp_reset_postdata(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment