Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After some trouble with custom post type/custom taxonomy permalinks I'm trying out custom post types with hierarchy = true and capability_type = 'page'. Would I miss out on any blog capabilities or go against some unspoken WordPress rule if I used this structure for my blog and my subblogs?

  • Blog (hierarchical CPT)
    • Subblog nr1 (CPT page)
      • Blogpost nr1
      • Blogpost nr2
      • ...etc
    • Regular blog post (page!) in the 'main blog'
    • Another regular blog post (page!) in the 'main blog'
    • Subblog nr2 (CPT page)
      • Blogpost nr1
      • Blogpost nr2
      • ...etc

Would this be a bad idea for some reason - I'm used to blogposts being posts but maybe this is just as good?

The reason why I want this structure is because it's easy to rewrite the permalinks the way I want them. For instance, I will create a tag taxonomy for each subblog and then it's easy to rewrite the tag archives like this: /blog/subblog_nr1/tags/tag_name

Also, of course, the subblog posts will automatically have the most obvious permalink: /blog/subblog_nr1/blogpost

My only problem then is how to show the subblog archive. I guess I could hack the single-blog.php to show the blogpost children if the blogpost has children. Any other ideas?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This would be a bad idea

Because custom post types are not blogposts, they thus dont have the same features with URLs etc. Going this route runs counter to the intentions behind custom post types, which are intended for building web apps, e.g. an event post type or a ticket post type etc So there will be many things missing like date based archives etc

Also doing ti this way will complicate your content management and create headaches when trying to separate posts from different blogs in the same category. It will also mean that most plugins which make the assumption of blog posts having the post type 'post' will fail to work for your 'faux blogpost' post types.

Instead, I reccommend you go with a WordPress Multisite install. Have a root blog that acts as your homepage, and lists the different sites/blogs in the network etc, and then have sites/blogs in subfolders.

As an example, this is the basic core premise that powers the Nottingham University Blogs site: http://blogs.nottingham.ac.uk

share|improve this answer
    
Yeah, maybe that's where we'll end up when all is said and done. One question: on our main frontpage we want to have a feed of news (normal wp-posts) and blogposts mixed together ordered by date. With your solution I guess we have to run a custom query since we want data from multiple tables (twice as many). Or is there a more simple way of getting data from another multisite instance? –  Richard B Mar 7 '12 at 9:34
    
On the Notts site, we grab every blog and show its latest post, and we have a featured post that gets shown at the top. There's no need for custom SQL –  Tom J Nowell Mar 7 '12 at 11:55
1  
nooo not at all, there's a whole array of functions you can use, there is absolutely no reason to use sql queries or wpdb for this. See codex.wordpress.org/Category:WPMU –  Tom J Nowell Mar 7 '12 at 15:48
1  
politics is a site, there are no categories or posts in the root site (though there is nothing preventing this) –  Tom J Nowell Mar 9 '12 at 12:33
1  
Thanks Tom! This has helped me a lot. For now we have to build something temporary for subblogs but when we rebuild our site your solution is definitely a good alternative. Thanks! –  Richard B Mar 9 '12 at 15:23
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.