• Hi,

    I’ve created a new custom post type of ‘project’
    This all works fine, however, I’m stuck trying to get my head around the permalinks, and have spend best part of a day trying to figure this out.

    What I’m aiming for is:

    To set up a new page with the following url /portfolio/ – this will link to a custom template that will display the posts (this is fine) – and it needs to also paginate.

    /portfolio/page/2/ etc

    All posts in the portfolio category will link to

    /portfolio/my-post-title/

    However, I’d love to get archives and categories sitting on the /portfolio/

    such as:

    /portfolio/archive/
    /portfolio/archive/2011/
    /portfolio/archive/2011/08/
    /portfolio/archive/2011/08/17/

    /portfolio/categories/category-slug/
    /portfolio/tags/tag-slug/

    How do I do this? Any ideas/pointers would be greatly appreciated.

    Thank you,
    Michael

Viewing 4 replies - 1 through 4 (of 4 total)
  • If all of the posts are going to have the url /portfolio/ at the start then enter /portfolio/%postname%

    I currently use /blogs/%category%/%postname%
    and get links like:

    post with category ‘example’: /blogs/example/post-9
    ‘example’ category link: /blogs/category/example
    archive link: /blogs/2011/07

    Hope that helps

    Thread Starter Michael

    (@michaelord)

    Sorry, I figures out yesterday that adding /blog/%postmane% would help me on my way, but my aim is to essentially get a blog and a portfolio running side-by-side, with exactly the same url structure etc. But with a different base (blog or portfolio) – I’ll eventually need to Add events in there, which will be a little more complicated, so I decided to start with a portfolio first.

    I’ve figured out that I need to add a ton of rewrite rules, because wordpress doesn’t seem to handle things logically… (unless I’m missing something)

    You’d have thought that setting your blog posts to point to a static page would allow you to hang all the subsequent pages off that – posts, categories, tags, archives etc.

    It would be cool if it did, as you could easily set up a new custom post type, and the functionality would be mirrored.

    Any other help would be greatly appreciated.
    Cheers

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Sam, that isn’t how CPTs work.

    Making a CPT with the slug ‘portfolio’ will make /portfolio/page/2/ and /portfolio/my-post-title/ work.

    Per http://codex.wordpress.org/Function_Reference/register_post_type you can add in taxonomies per CPT but I don’t know how you’d call them into yoru URL structure.

    Thanks for the info Ipstenu, I overlooked the part about it being a CPT.

    Having looked a little into CPT, I came across:
    http://codex.wordpress.org/Post_Types

    There is a section in there about URL’s, it might help.

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

The topic ‘Custom Post Types and Permalinks’ is closed to new replies.