Loop through Custom Post Types in Wordpress

Alan Ashbaugh 18th of April 2012

<?php $loop = new WP_Query( array( 'post_type' => '[post-type-name]') ); ?>

	<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

<?php the_title(); ?>
<?php the_content();?>

	<?php endwhile; ?>
224
Views
0
Comments
1
Downloads
Comments
Only Code Pad members can post comments!

Want to join Code Pad Request An Invite
    No Comments Posted

Suppo - Create, Customize & Host
Your App Support Page at Suppo

Snippet Details

Keyboard Shortcuts

DDownload

TTweet

FFull View

Next Snippet

Previous Snippet