• I’m using the custom post type plugin and have a site structure such as site.com/what-we-do/current-projects/ which has a PHP page (type-hfac_project.php). There’s two things I want to be able to do:

    • I want the slug to be site.com/what-we-do/current-projects/my-project-name/, at the moment it goes to site.com/projects/my-project-name/
    • Pagination on the custom post type PHP pages, how is this done?

    This is what my rewrite looks like in the functions.php (an extract):

    'rewrite' => array('slug' => 'projects'),

    Unfortunately I’m no expert in WP and have relied on community posts / blog posts to get this far. Hopefully the community experts could give me a helping hand? Apologies if these are quite simple, and perhaps “search-answerable” questions. I have not found any solutions as of yet.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not sure if that’s possible because a custom post type is essentially a new content type – it’s not a subpage of What we Do > Current Projects, but rather creates a new slug hierarchy – a bit like the categories slug I believe i.e. site.com/category/category-name/.

    Would love to be corrected on that though as it would be useful to do.

    Thread Starter Kezzer

    (@kezzer)

    Okay, the problem was my lack of knowledge, but this is possible to do using the following slug:

    'rewrite' => array('slug' => 'what-we-do/current-projects'),

    Then you must visit the Settings > Permalinks page to refresh the permalinks (this was the missing step). So, I’ve managed to get that working. This isn’t documented in any of the custom post type plugin pages that I’ve seen so far, and it’s probably something they should include.

    Cool, thanks for sharing the knowledge!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Post Type Slug/Pagination’ is closed to new replies.