Skip to content

Instantly share code, notes, and snippets.

@timwco
Created February 17, 2011 15:50
Show Gist options
  • Save timwco/831960 to your computer and use it in GitHub Desktop.
Save timwco/831960 to your computer and use it in GitHub Desktop.
Wordpress - Custom Post Loop
<?php $loop = new WP_Query( array( 'post_type' => 'custom_post_type_name', 'posts_per_page' => 100 ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="post">
<?php the_post_thumbnail(); ?>
<div class="postInfo">
<h3 class="lgr"><?php the_title() ?></h3>
<a href="<?php the_permalink() ?>">Read More</a>
</div>
</div>
<?php endwhile; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment