PhotoDune

Custom Loop and 404 pagination!

949 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Ireland
  • Sold between 10 000 and 50 000 dollars
EireStudio says

I have to get 2 categories worth of posts in one page (just testing with 1 category until the 404 gets fixed), so I have the following code. The first 10 posts are perfect, but when I try to navigate to page 2/3 etc, I get a 404…

What’s wrong with my code? :(

<?php get_header(); ?>

<div id="content">

    <h1 class="gotham"><?php single_cat_title(); ?></h1>

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
    $args = array
    (
        'paged' ?> $paged,
        'cat' => 7
    );
    query_posts($args);
    while(have_posts()) : the_post(); ?>
        Yep 
    <?php endwhile; ?>

    <?php wp_pagenavi(); ?>        

    </div>

    <?php get_sidebar(); ?>

<?php get_footer(); ?>
973 posts
  • Sold between 100 and 1 000 dollars
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Microlancer Beta Tester
  • United States
fillerspace says

What is the link that wp_pagenavi generates? Can you change to next_posts_link() to see if that generates a different URL ?

949 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Ireland
  • Sold between 10 000 and 50 000 dollars
EireStudio says

What is the link that wp_pagenavi generates? Can you change to next_posts_link() to see if that generates a different URL ?

Exact same url: .../news-offers/page/2/ :(

2900 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 50 and 99 items
  • Referred between 1000 and 1999 users
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark moderator says

Is this possibly the issue where you have a page and a custom post type with the same name/slug? Or colliding page/category/post/custom post slugs perhaps?

Might be worth looking at the details of this plugin, too: http://wordpress.org/extend/plugins/category-pagination-fix/

by
by
by
by
by