WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a custom post type with name career. I would like to know what's the best way to list the posts. I created a page template with a query inside, but the pager is invisible. I don't know what's wrong.

<table id="career">
                <td>Close date</td>
                <td>View details</td>
        <?php $mypost = array( 'post_type' => 'career', );
        $loop = new WP_Query( $mypost ); ?>
        <?php while ( $loop->have_posts() ) : $loop->the_post();?>
            $custom = get_post_custom($post->ID);
            $location = $custom["location"][0];
            $close_date = $custom["close_date"][0];
        <tr id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <td><?php the_title(); ?></td>
            <td><?php echo $location; ?></td>
            <td><?php echo $close_date; ?></td>
            <td><a href="<?php the_permalink(); ?>" title="Details">> Details</a></td>
        <?php endwhile;  ?>
        <div class="nav-previous"><?php next_posts_link( '<span class="meta-nav">&larr;</span> Older'); ?></div>
        <div class="nav-next"><?php previous_posts_link( 'Newer<span class= "meta-nav">&rarr;</span>' ); ?></div>

How do you list your custom post types with pager?

share|improve this question

Refer to the Template Hierarchy Codex entry.

For your pagination issues with a custom query loop, look for related questions on the site.

share|improve this answer
What do you think about creating page template instead of archive-...php? I prefer that because my client can edit the content above the career, and he can use any url/title. Or this method is not recommended? – robert Feb 24 '13 at 21:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.