Last active
July 17, 2024 14:47
-
-
Save kevinwhoffman/97c0f6c4be117fb389e9 to your computer and use it in GitHub Desktop.
WordPress - Custom Post Type 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 | |
$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(); ?> |
Thank you very much
Terima Kasih
Super clean. Thank you!
Exactly what I need. Thank you!
don't forget 'post_status' => 'publish' so it only returns published posts
Awesome thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice and clean!