Created
June 19, 2013 20:48
-
-
Save colorful-tones/5817902 to your computer and use it in GitHub Desktop.
Custom Post Type query
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
<!-- Custom Post Type Loop --> | |
<?php $query = new WP_Query(array( | |
'post_type' => 'testimonials', | |
'posts_per_page' => -1, | |
'orderby' => 'rand' | |
)); | |
while ( $query->have_posts() ) : $query->the_post(); | |
echo '<div class="custompost">'; | |
the_content(); | |
echo '<div class="customposttitle"> '.get_the_title().'</div>'; | |
echo '</div>'; | |
endwhile; | |
wp_reset_postdata();?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment