Created
November 9, 2018 15:39
-
-
Save Farmatique/83f6cffa69013e28f01e855be5d07c6a to your computer and use it in GitHub Desktop.
Wordpress: custom post type loop
This file contains hidden or 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' => 'testimonials', 'posts_per_page' => 10 ); | |
$query = new WP_Query( $args ); | |
while ( $query->have_posts() ) : $query->the_post(); | |
?> | |
<h2> <?php echo the_title(); ?></h2> | |
<div class="content"> | |
<?php echo the_content(); ?> | |
</div> | |
<?php | |
endwhile; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment