Support » Themes and Templates » Custom Post Type (Post List Template)

  • Hello Everyone… I have a question I have been trying to figure out over the past 4 hours which involves the use of custom post types.

    I currently have wordpress 3.0 setup with 5 custom post types one of which is for example “events”.

    Now, I have everything working perfectly on the backend side of thing and I am able to get all the public event detail pages to show up (which follow the url string)

    I am using the single-post-type-name.php to style the individual event detail pages which works perfectly.

    The ONLY issue I have here is that I just can’t seem to figure out a way to create a template page for the public event list page.

    In other words… I just want to have custom template assigned when a visitor goes to so I can list all the events associated with this custom post type.

    Can ANYONE please provide me with some quick guidance here??? I would greatly appreciate it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • not sure – i am looking for something else myself but i came accross this and it might help you

    One solution is to create a page called “List of Events” and assign a page template to that page where the page template has something like:

      'post_type' => 'events',
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      echo 'List of Events';
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    wp_reset_query();  // Restore global post data stomped by the_post().

    Is this really the only options… there is nothing which lets me create a type of list template for a post type??? I find this hard to believe that they did everything except for that for simple integration of these type of posts…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Post Type (Post List Template)’ is closed to new replies.