WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Types Pagination not working (404 error) (2 posts)

  1. iign
    Member
    Posted 4 years ago #

    Hi, I know this has been asked before, but none of the solutions worked for me, I've reset the permalinks, etc. to no avail. This is my setup:

    I have a custom post type called ted_venue, and two templates, single-ted_venue.php (single venue details) and page-venues.php (for displaying a list of venues). Permalink structure is site.com/venues/venue-slug for venue detail and site.com/venues for venues list.

    Venue details and list of venues were working OK until I wanted to add pagination to the list of venues.

    This is the pagination code on list of venues:

    $paged = get_query_var('paged') ? get_query_var('paged') : 1;

    `$wp_query = new WP_Query(array('post_type' => 'ted_venue',
    'paged' => $paged,
    'posts_per_page' => 30,
    'orderby' => 'title',
    'order' => 'ASC')
    );

    if ($wp_query->have_posts()):

    ?>

    <ul>
    <?php while ($wp_query->have_posts()): $wp_query->the_post(); ?>
    ...`

    Then at the bottom I add a few pagination links. If I go to site.com/venues/page/2 it brings a 404 error.

    Then, if I reset permalinks to default and then to current, venue-list pagination works OK but single venue detail doesn't. So, basically when pagination works single venue doesn't and viceversa.

    I'd really appreciate some help!
    ignacio

  2. rafaelxy
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic