Home > Support > Forum

Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Pagination Error when pulling in custom posts through a page template

UserPost

9:28 pm
July 1, 2010


larissa

New Member

posts 1

1

This is a great plugin!!!

I'm not sure if the issue I am having is due to a WP pagination bug that leads to 404 errors… or if it due to the plugin rewrite rules.

Here's a link to what I'm working on: CLICK HERE

The Problem:

  • When I click the 2nd page – I get a 404. But I am able to view the projects.
  • When I resave my permalink settings, I am able to click the 2nd page but then the project posts all go to 404 pages and can't be found.

I have tried a variety of permalink settings but I can't seem to get both the pagination and the portfolio post pages to work togther.

What I'm doing is using custom post types to display my portfolio, seperate from my blog posts.  In doing so I created a custom page called “portfolio” that uses a template to pull in all of the custom portfolio posts. I have a total of 12 in so far. What I want to do is display 9 posts per page and then let pagination display the rest on seperate pages.

This is what I am using to pull in the portfolio custom post types – on my template page.

<?php if (have_posts()) : ?>
     <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
     query_posts('post_type=portfolio&paged='.$paged); ?>
        <?php while (have_posts()) : the_post(); ?>


<—-LOOP THEN GOES HERE —->


I belive the way I have set this up is correct but I noticed that I get a 404 when I click the 2nd page.


Right now my only solution might be to not use pagination and display all of the posts on one page. :(


I was wondering if anyone else was having issues with pagination or if they found a solution that works with this plugin or with Custom Post Types?


8:29 am
July 18, 2010


petebarr

New Member

Dublin

posts 1

2

Hi Larissa,


I'm having exactly the same problem with pagination for my custom post type but can't find a solution anywhere. Have you had any luck with this yet?


Cheers,


Pete.

4:03 pm
July 23, 2010


mfields

Member

Portland, OR

posts 3

3

For my own custom post_type project, I decided to rewrite the paging by hand for the page_template. My friend Devin just released a theme that uses custom post types and he is using this plugin to deal with the issue: http://wordpress.org/extend/pl…..-archives/ Hopefully this helps. And just a note, you should test paging with a normal “Page” as well as when the page is set as the “Front Page”. WordPress seems to assign different query vars in each situation.

Search 


If you can dream it, we can build it! Please contact us today to discuss your ideas and how WebDevStudios can help you today!