WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pagination in custom post-type template file (10 posts)

  1. phiworx
    Member
    Posted 4 years ago #

    I have created a custom posttype News, and registered a taxonomy for it. On the taxonomy pages, pagination is working fine, but not on the template page I have made for it. It keeps giving me a 404 error.

    Is it not possible to have pagination on a template page?

  2. MichaelH
    Member
    Posted 4 years ago #

    Assuming you have updated your permalinks...

    Are you talking about pagination of a page of posts of a custom post type, or are you talking about pagination of a single post?

    You might want to paste your template code in a pastebin and report the link back here--maybe someone can spot a problem.

  3. phiworx
    Member
    Posted 4 years ago #

    Yes, it's a page of posts for a post type.

    Here is my query:

    http://pastebin.ca/1885763

    Thanks!

  4. MichaelH
    Member
    Posted 4 years ago #

    The page of posts example in the Pages article has a working example of pagination you might consider.

  5. phiworx
    Member
    Posted 4 years ago #

    Thanks, but I figured it out. It was a permalink issue.

  6. phiworx
    Member
    Posted 4 years ago #

    Thanks, but I figured it out. It was a permalink issue. But now I have another issue.

    After changing the permalink to /%category%/%postname%, the pagination works, but now it won't show my terms-pages.... It's a neverending story this.

  7. Fleetstar
    Member
    Posted 4 years ago #

    You may try changing the permalink to /%taxonomy%/%postname%

  8. Harish Chouhan
    Member
    Posted 3 years ago #

    The pagination on my custom post type pages at http://www.dreamsmedia.in/work/ were appearing but then http://www.dreamsmedia.in/work/page/2/ would give 404 error.

    Until this my permalink was like /%category%/%postname%/.

    I tried all methods including those mentioned at http://wordpress.org/support/topic/pagination-with-custom-post-type-listing?replies=18 and nothing working.

    Later I changed my permalink structure to /%year%/%monthnum%/%day%/%postname%/ and now everything is working.

  9. Harish Chouhan
    Member
    Posted 3 years ago #

    SORRY

    That had not solved the issues. Guys if your code is correct, then to make the website work, simply do this

    1. set your permalinks to default and then delete the .htaccess file
    2. reset the permalinks to whatever you want and then upload the htaccess file back.

  10. Harish Chouhan
    Member
    Posted 3 years ago #

    not helping. When i fixed the pagination, the individual page for the custom post type are not opening and I get a 404 error.

Topic Closed

This topic has been closed to new replies.

About this Topic