Hey Guys,
Head is getting melted with this pagination crap in WordPress! What am I doing wrong here…
Test site
http://www.clients.eirestudio.net/savvas/reviews/Code
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("post_type=bingo_review&posts_per_page=1&paged=$paged");
if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
blah
<?php endwhile; ?>
<?php endif; ?>
<?php wp_paginate(); ?>
Anybody? /cries in corner
I had 404 error when visiting single post page for custom post type but don’t know if your problem for the same reason or not. Here is how I got my problem solved , try and see if it will solve yours:
You need to add flush_rewrite_rules() function just before the closing tag of the main function that registers the custom post type. See the example below…
function my_post_type() {
register_post_type(
/* your custom post type settings */
);
flush_rewrite_rules( false );
}
Hope that helps you 
Thanks for the reply prem, but I think that is just if the custom post type itself is throwing a 404, you can also just visit the permalinks page to solve that one. This however is with pagination, bloody WordPress!!
RedHenry said
Anybody? /cries in corner
could you give us more information…
1) the complete code of your register_post_type for this “bingo_review” post type
2) an URL of your single “bingo_review” post (for example)
agusmu said
RedHenry said
Anybody? /cries in cornercould you give us more information…
1) the complete code of your register_post_type for this “bingo_review” post type
2) an URL of your single “bingo_review” post (for example)
No probs, thanks for the help!
1. Register Post Type Function Code
/*
Create New Post Types
*/
add_action('init', 'create_bingo_reviews_post_type');
function create_bingo_reviews_post_type()
{
register_post_type
(
'bingo_review', array
(
'labels' => array
(
'name' => 'Bingo Reviews',
'singular_name' => 'Bingo Review',
'add_new' => 'Add New Bingo Review',
'add_new_item' => 'Add New Bingo Review',
'edit' => 'Edit Bingo Reviews',
'edit_item' => 'Edit Bingo Review',
'new_item' => 'New Bingo Review',
'view' => 'View Bingo Review',
'view_item' => 'View Bingo Review',
'search_items' => 'Search Bingo Reviews',
'not_found' => 'No Bingo Reviews found',
'not_found_in_trash' => 'No Bingo Reviews found in Trash',
'parent' => 'Parent Bingo Review'
),
'supports' => array
(
'title',
'editor',
// 'excerpt',
//'trackbacks',
'custom-fields',
// 'comments',
'revisions',
'thumbnail',
//'author',
//'page-attributes'
),
'public' => true,
'rewrite' => array('slug' => 'reviews'),
'has_archive' => true,
'query_var' => true,
'menu_position' => 4,
'_builtin' => false // It's a custom post type, not built in!
)
);
}
2. Bingo Review Example
http://www.clients.eirestudio.net/savvas/reviews/city-bingo/- edited -
FIRST , because you use has_archive, i need you to replace
'has_archive' => true,
with
'has_archive' => 'reviews',
SECOND , what is this link?
http://www.clients.eirestudio.net/savvas/reviews/Is it a page with a custom page template? If yes, DELETE this page permanently (clear the trash also)...
THIRD , go to Settings > Permalinks, and then update your permalinks TWICE !
FOURTH , we will create custom page to display the archive of “bingo_review” page. The file name is archive-bingo_review.php . You can duplicate your index.php or archive.php to archive-bingo_review.php
This is the correct way to create an archive page for a custom post type when you use has_archive parameter.
Then, you can modify archive-bingo_review.php to get what you want (custom posts per page, etc)
First = Done
Second = it’s the bingo review archives.
http://www.clients.eirestudio.net/savvas/reviews/ <- reviews is the rewritten slug.There is no page called reviews and no collisions etc.
Third = done
Fourth = I already have the archive-bingo_review.php page created.
Thanks anyway man, WordPress and pagination is getting to be a right bitch to work with!
RedHenry said
Thanks anyway man, WordPress and pagination is getting to be a right bitch to work with!
does it work now? If not, feel free to send the WP login to me through my profile page, and I will check your code. 
