• Resolved tjldesigns

    (@tjldesigns)


    Hello,

    REALLYYYY hoping someone can put me out of my misery. So… I have a custom post type with “Post Type Slug” : “clients”

    I have created a custom page archive, as I wanted to include intro text, etc. so this is named “page-clients.php” and powers my client page which is of course accessible via /clients/ which in turn feeds my custom post type “clients” posts. All this is perfect.

    So my archive page is /clients/ and a client detail page is /clients/client-name-here/

    The PROBLEM is once paging kicks in… it has “page not found” when you go to any of the paged links ie : “/clients/page/2/”

    I see some people are saying that you can’t have the same slug, ie I should have /clients/ for my custom archive page, then for the individual pages have something like /client/client-name-here/ BUT I don’t want that :(, I want to be able to use :

    /clients/ (my custom archive page)
    /clients/page-name-here/ (my individual client pages)
    /clients/page/2/ (my paging on the archive page)

    I have seen others achieve what I want so I know it must be possible. Can anyone at all help with this, save my weary brain cells further grief 🙂

    https://wordpress.org/plugins/custom-post-type-ui/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    is there any reason you’re using a page with a custom query instead of letting WP core make the archive for you? Allowing that should also take care of the pagination issues you’re experiencing.

    Thread Starter tjldesigns

    (@tjldesigns)

    Hi Michael,

    Thanks ever so much for your reply. I ideally wanted to use my custom page purely because I have some acf custom fields which can also be populated for this page, which I wouldn’t be able to achieve so easily/logically if I change it to a standard WP archive page.

    But are you saying that’s really my only option to be able to resolve this?

    Thanks again 🙂

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    It’d be the easiest. Pagination with custom queries is not always the easiest/most fun thing to get working, and I have never managed to nail down a for-sure way to get it to work each time.

    Depending on the ACF stuff that you’re wanting, and how those are meant to be used, it should be possible to still fetch them even from an archive.php template file, as long s the ACF functions can accept a specific post ID. Just feed in the specific ID for the page holding them, and that should fetch them just fine. Otherwise, I’d end up having to google around myself to try and find a resource to help with the pagination issue.

    Thanks Michael, had the same issue and this pointed me into the right direction…

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Good to hear. 🙂

    Thread Starter tjldesigns

    (@tjldesigns)

    Thanks for this Michael – I will get this changed around to an archive page and at least I know this for future reference :).

    And excellent plugin by the way!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Post Type Slug and paging’ is closed to new replies.