WordPress.org

Ready to get started?Download WordPress

Forums

Custom Pagination on Custom Post Type (3 posts)

  1. dhtbrowne
    Member
    Posted 2 years ago #

    Okay - So I'm building a site which has a product listing. The products are categorised by category... But you can also categorise by supplier.

    So I have a custom post type called products and a custom post type called suppliers.

    When the user goes to one of the supplier pages, on that page it lists all the products that are made by that supplier. This is referenced with post meta data for each product having a supplier parent kinda thing.

    The issue I'm coming across is I only want to list 12 products per page for the suppliers (I have a custom loop). I have the loop sorted and everything else works fine... My issue is I can't seem to pass the paged variable through on the supplier pages like I can on a normal archive page... My guess being because archive pages usually need the pagination anyway... So assuming it's just a rewrite rule thing. But I've not done much with WordPress rewrite rules... So can't figure out what rules I need to do to make it work.

    The URL structure would be like this:

    site.com/suppliers/*suppliername*/page/*pagenumber*/

    The stuff with asterisks around it being the variable names.

    So an example url might be /suppliers/levo/page/2/... But by default it rewrites to /suppliers/levo/.

    Can anyone help?

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

  3. dhtbrowne
    Member
    Posted 2 years ago #

    Hmmmm I'd really rather not use an extra plugin if possible... I've pretty much got the whole thing working... It's just the url rewriting I can't get right.

Topic Closed

This topic has been closed to new replies.

About this Topic