Custom Post Type Archive Loop
Replace ‘name’ with the appropriate custom post type slug to query only those posts. Since the args are in an array, multiple post type slugs can be used. Multiple post type archives can be created from one template file with if/else statements.
Place in template file.
1 2 3 4 5 6 7 8 9 10 11 | <?php $args = array( 'post_type' => 'name' ); $name = new WP_Query($args); while ( $name->have_posts() ) : $name->the_post(); ?> <h3 class="postTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php endwhile; ?> |