<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="<?php echo $post->post_name; ?>"> <h2><a href="<?php the_permalink(); ?>"

title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>

</div><!-- .post --> <?php endwhile; ?> <?php else: ?>

<p>Sorry, these posts could not be found.</p> <?php endif; ?> </div><!-- #main -->

<?php get_sidebar(); ?> <?php get_footer(); ?>

As you'll see in Chapter 12, you can use the post_type attribute to list custom post types as well as pages or attachments.

0 0

Post a comment