Title: Custom type post loop problem
Last modified: August 19, 2016

---

# Custom type post loop problem

 *  [darkdoyle](https://wordpress.org/support/users/darkdoyle/)
 * (@darkdoyle)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/custom-type-post-loop-problem-1/)
 * I have set up a custom post type “sagi” and I’m trying to get the post to display
   on example.com/sagi/ using the following code, but the “« Older Entries” link
   goes to example.com/sagi/page/2 which does not exist so it brings up the 404,
   Is there anything that can be done about this or can I only show the 10 latest
   posts on a page?
 *     ```
       <?php
   
       /*
       Template Name: SaGi
       */
   
       get_header(); ?>
       <?php
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts('paged=' . $paged . '&post_type=sagi');
       ?>
       <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>
       <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
       <?php the_content(); ?>
       <?php endwhile; ?>
   
       <?php next_posts_link('&laquo; Older Entries') ?>
       <?php previous_posts_link('Newer Entries &raquo;') ?>
   
       <?php else : ?>
       <?php endif; ?>
       <?php
   
       wp_reset_query();
       ?>
       <?php get_footer(); ?>
       ```
   

The topic ‘Custom type post loop problem’ is closed to new replies.

## Tags

 * [custom loop](https://wordpress.org/support/topic-tag/custom-loop/)
 * [page](https://wordpress.org/support/topic-tag/page/)

 * 0 replies
 * 1 participant
 * Last reply from: [darkdoyle](https://wordpress.org/support/users/darkdoyle/)
 * Last activity: [15 years, 12 months ago](https://wordpress.org/support/topic/custom-type-post-loop-problem-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
