Next_Posts_Link() Leads to 404
-
On my
index.phppage I’m trying to show a limited amount of my custom post type ‘products’, and for some reason I can’t seem to get the next and previous links to work. They work fine on the single.php page. It’s what I click a products category (which is a taxonomy):function product_category_taxonomy() { $labels = array( 'name' => __( 'Product Categories' ), 'singular_name' => __( 'Product Category' ), 'search_items' => __( 'Search Product Categories' ), 'all_items' => __( 'All Product Categories' ), 'parent_item' => __( 'Parent Product Category' ), 'parent_item_colon' => __( 'Parent Product Category:' ), 'edit_item' => __( 'Edit Product Category' ), 'update_item' => __( 'Update Product Category' ), 'add_new_item' => __( 'Add New Product Category' ), 'new_item_name' => __( 'New Product Category' ), 'menu_name' => __( 'Product Categories' ), ); $args = array( 'labels' => $labels, 'hierarchical' => true ); register_taxonomy( 'product-category', 'products', $args ); } add_action( 'init', 'product_category_taxonomy');I have to do a custom query right under
get_header()$paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; $products = new WP_Query(array( 'post_type' => 'products', 'posts_per_page'=> 2, 'paged' => $paged ));My navigation looks like this:
<div class="alignleft"><?php next_posts_link('« Older Entries', '1000') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »', '1000') ?></div>The ‘Older Entries’ link just leads to a 404 page and I can’t figure out why. What could the possibilities be?
The topic ‘Next_Posts_Link() Leads to 404’ is closed to new replies.