WordPress.org

Ready to get started?Download WordPress

Forums

What is sub-custom post types (5 posts)

  1. rich_brat
    Member
    Posted 2 years ago #

    In this thread Ipstenu posted a comment saying CPT's can have children:
    http://wordpress.org/extend/ideas/topic/taxonomy-archive-template/page/3#post-21421

    I would like to know, maybe I misunderstood, but is it possible to have cpt's inside cpt's like this:

    1. CPT no 1 with archives etc
      1.1 Regular post
      1.2 CPT no 2 with archives etc
        1.2.1 Regular post
      1.2 Regular post
      1.3 ...etc
  2. Angry Creative
    Member
    Posted 2 years ago #

    You could do it, but you would probably end up having a very stiff IA & require that you make a new template file (archive-posttype.php) for each of them. A freaking nightmare to update!

    Thats pretty useless for dynamically adding new types with a click. We use cpts+taxonomies with custom rewrites instead.

  3. rich_brat
    Member
    Posted 2 years ago #

    Thanks for your reply Angry Creative!
    This is sort of an emergency so it's ok if the structure is a bit stiff, when we rebuild our site we'll do it right from the beginning. But right now we've got a blog running on example.com/blog built on a CPT and we need to set up another blog quickly. We would really like the URL to be example.com/blog/new_blog but I can't get this to work. This is what I've got:

    blog (CPT with 'rewrite' => true)
    blog-tags (non-hierarchical taxonomy with 'rewrite' => 'blog/blog-tags')

    new_blog (CPT with 'rewrite' => 'blog/new_blog')
    new_blog-tags (non-hierarchical taxonomy with 'rewrite' => 'blog/new_blog/new_blog-tags')

    Everything works like a charm except the new_blog-tags taxonomy, the URL example.com/blog/new_blog/new_blog-tags/some-tag gives me a 404 error. Why is that?

  4. Angry Creative
    Member
    Posted 2 years ago #

    Check our blog how we solved these kinds of problems (I think youvé left a comment already?)

    a tip for analyzing: http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/

    If you can't solve it and need our services, hollar!

  5. rich_brat
    Member
    Posted 2 years ago #

    Yes I did, and I tried your solution. Maybe I did something wrong but I couldn't make it work with the CPT-blog I already had up and running.

    Haven't seen that plugin before - great stuff, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic