Posted By

i-am-andy on 06/27/12


Tagged

post wordpress types custom


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ignacio


List Custom Post Type anywhere


 / Published in: PHP
 

Useful for adding Custom Post types to navigation this will list all custom post type posts

  1. <?php query_posts( array( 'post_type' => 'Beers', 'showposts' => 10 ) );
  2. if ( have_posts() ) : while ( have_posts() ) : the_post();
  3. ?>
  4. <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
  5.  
  6. <?php endwhile; endif; wp_reset_query(); ?>

Report this snippet  

You need to login to post a comment.