Skip to content

Instantly share code, notes, and snippets.

@axxe16
Last active February 16, 2022 14:03
Show Gist options
  • Save axxe16/418359a51db473bc86bdbc75e9559c31 to your computer and use it in GitHub Desktop.
Save axxe16/418359a51db473bc86bdbc75e9559c31 to your computer and use it in GitHub Desktop.
wp_query loop base #loop #wp #WP_query
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => '-1'
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment