Loop through Custom Post Types in Wordpress

<?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; ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.