WordPress.org

Forums

custom post_type list pagination (4 posts)

  1. errantenl
    Member
    Posted 3 years ago #

    Hi there,

    Trying hard to paginate a list of a certain custom post type, but I cannot get any of the examples to function right. The first page is shown, and also the link to the second page, but when clicked on the result is "not found". Here is the code I use:

    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query( array(
    'post_type' => 'vacatures',
    'posts_per_page' => 100,
    'orderby'=> 'ASC',
    'paged'=>$paged ,
    ) ); ?>

    <table id="vacaturelijst" width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <th scope="col">Titel/Omschrijving</th>
    <th scope="col">Functie</th>
    <th scope="col">Plaats</th>
    </tr>
    <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
    <tr class="row">
    <?php the_title( '<td width="309">', '</td>' ); ?>
    <td width="155">"><?php echo get_post_meta($post->ID, 'functie', true); ?></td>
    <td width="155">"><?php echo get_post_meta($post->ID, 'plaats', true); ?></td>
    </tr>
    <?php endwhile; // end of the loop. ?>
    </table>
    <div class="navigation">
    <div class="alignleft"><?php previous_posts_link('« Previous') ?></div>
    <div class="alignright"><?php next_posts_link('More »') ?></div>
    </div>
    <?php $wp_query = null; $wp_query = $temp;?>

  2. Lucian Florian
    Member
    Posted 3 years ago #

    Try to refresh the permalinks. This is a common problem.

  3. errantenl
    Member
    Posted 3 years ago #

    Thanks for your quick answer. I am afraid it didn't give result though. What else could be the problem?

  4. errantenl
    Member
    Posted 3 years ago #

    Is there no way to make this work? Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic