Skip to content

Instantly share code, notes, and snippets.

@JoeSz
Forked from kevinwhoffman/loop-custom.php
Created June 17, 2020 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeSz/105b9b5e3ffd3d801ef9a22cb7ef7ec7 to your computer and use it in GitHub Desktop.
Save JoeSz/105b9b5e3ffd3d801ef9a22cb7ef7ec7 to your computer and use it in GitHub Desktop.
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<!-- do stuff -->
<?php endwhile; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment