views:

151

answers:

2

So I've just made a custom post type for my wordpress theme named "Products". When I create a new post in it and view it, the link is something like this:

"http://localhost/wordpress/product/a-product-title"

This page views as expected but when I try to go to the supposed parent page:

"http://localhost/wordpress/product/"

I get a 404 error page. Is there a special template I need to make to view this page?

Thanks

+1  A: 

I found what to do. I just created a new page called "Products" and set it as the posts page. Then I put this in front of the loop

$wp_query = new WP_Query("post_type=product");

and it worked

codedude
But that will override the normal loop if the OP is also making use of the standard post type (i.e running a typical blog).
TheDeadMedic
In this situation it works fine.
codedude
+1  A: 

I had the same issue - I think it's down to the fact that right now, WP 3.0 simply does not behave as you would expect with custom post type 'archives'.

Check out Smarter Custom Posts to easily build-in this behaviour.

TheDeadMedic