[wp-hackers] custom_post_type and custom taxonomy naming

Mike Schinkel mikeschinkel at newclarity.net
Sun Aug 22 05:19:25 UTC 2010


> On Aug 21, 2010, at 9:33 PM, Lox wrote:
> 
>> 2010/8/22 Mike Schinkel <mikeschinkel at newclarity.net>
>> 
>> For example, having a "product" taxonomy *could* give a list of posts at
>> http://example.com/products/ and then each "product" post could display at
>> http://example.com/products/

Wow, I misspoke, I was tired and distracted (was sitting in WordCamp Savannah) when I sent that. Sorry.

I meant to say:

For example, having a "product" taxonomy *could* give a list of posts at http://example.com/products/ and then each "product" post could display at http://example.com/products/%product%/

What I am currently doing is setting "rewrite" to false for the taxonomy and creating a Page for the /products/ URL and using a shortcode to retrieve the posts I want displayed.  My shortcode accepts "post_type" and defaults to using WP_Query() to generate a full list of all posts of my post type but with additional arguments that allow me to specify what WP_Query() will get passed.  By default my shortcode looks for "page-%post_type%.php" in my theme's directory to display a single post so for a product it would look for "post-product.php."

That all works rather well but takes a bit too much fiddling for what I think is an would be a common use-case.  It would be nice if a URL for http://example.com/%post_type%/ would be automatically generated and if there is a taxonomy with the same name that the taxonomy would be automatically mirrored and that the /%post_type%/ URL would then be filtered by the posts that are associated with that taxonomy. JMTCW, as always.

-Mike

On Aug 21, 2010, at 9:33 PM, Lox wrote:

> 2010/8/22 Mike Schinkel <mikeschinkel at newclarity.net>
> 
>> For example, having a "product" taxonomy *could* give a list of posts at
>> http://example.com/products/ and then each "product" post could display at
>> http://example.com/products/
>> 
> 
> That is exactly what I am trying to do at the moment, but it seems I can't
> ......
> 
> -- 
> Lox
> lox.dev at knc.nc
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list