custom post_type list pagination (4 posts)

  1. errantenl
    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:

    $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">
    <th scope="col">Titel/Omschrijving</th>
    <th scope="col">Functie</th>
    <th scope="col">Plaats</th>
    <?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>
    <?php endwhile; // end of the loop. ?>
    <div class="navigation">
    <div class="alignleft"><?php previous_posts_link('« Previous') ?></div>
    <div class="alignright"><?php next_posts_link('More »') ?></div>
    <?php $wp_query = null; $wp_query = $temp;?>

  2. Lucian Florian
    Posted 3 years ago #

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

  3. errantenl
    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
    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