WordPress.org

Ready to get started?Download WordPress

Forums

Custom post type plus custom taxonomy permalink structure (7 posts)

  1. Justin Carroll
    Member
    Posted 2 years ago #

    With custom post types and custom taxonomies at play is there any way to structure premalinks like this:

    http://site.com/portfolio/ (all category index)
    http://site.com/portfolio/photography/ (category index)
    http://site.com/portfolio/photography/lorem-ipsum-dolor/ (single post)

    Right now I can get it to work only 2 ways. Like this:

    http://site.com/portfolio/ (archive-portfolio.php)
    http://site.com/portfolio/photography/ (taxonomy.php)
    http://site.com/portfolio/lorem-ipsum-dolor/ (single-portfolio.php)

    Or like this:

    http://site.com/portfolio/ (page-portfolio.php page template)
    http://site.com/portfolio/category/photography/ (taxonomy.php)
    http://site.com/portfolio/lorem-ipsum-dolor/ (single-portfolio.php)

    Custom post types and cust taxonomies have come a long way, but they're still not very smooth. Any help would be appreciated. Thanks!

  2. Justin Carroll
    Member
    Posted 2 years ago #

    Bump. No one? I can't be the only one in search of the perfect permalink structure!

  3. Fleetstar
    Member
    Posted 2 years ago #

    You could try this plugin:
    Custom Post Permalinks

  4. Justin Carroll
    Member
    Posted 2 years ago #

    Thanks for the suggestion, but I'd much rather do this without a plugin.

  5. lerizzle
    Member
    Posted 2 years ago #

    @3circlestudio did you ever find your solution?

  6. Justin Carroll
    Member
    Posted 2 years ago #

    Yes, I did. Thanks for the reminder. There's an array option when creating a custom post type and custom taxonomy for "rewrite" and you can set a "slug" and it's there that you can change your permalink structure ... http://codex.wordpress.org/Function_Reference/register_post_type

    Other than that like Feetstar said you can use a plugin, but I hate to rely on plugins for functionality that should really be native to the system or theme.

    Hope that helps!

  7. pagameba
    Member
    Posted 2 years ago #

    I'm having the same problem as you originally described, I don't quite grok how to make it work using the register_post_type function - any chance you could post something to demonstrate what you did to solve the problem, nothing I've tried is working.

Topic Closed

This topic has been closed to new replies.

About this Topic