Skip to content

Instantly share code, notes, and snippets.

@gabrielgodoy-zz
Forked from kevinwhoffman/loop-custom.php
Created September 22, 2018 03:56
Show Gist options
  • Save gabrielgodoy-zz/0a0ffd97aa28221eaa839fdafd6c66a4 to your computer and use it in GitHub Desktop.
Save gabrielgodoy-zz/0a0ffd97aa28221eaa839fdafd6c66a4 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