I have a blog with two post types. One is default ‘post’ and the other one is custom post type ‘video’. In permalink options I choosen ‘custom structure’:
/posts/%postname%/
I created ‘archive.php’ in the theme directory. I supposed that url ‘/posts/’ should cause wordpress to use ‘archive.php’ as template for posts loop page. But I’m getting ‘Page not found’ title with ‘index.php’ as template file. How to fix it?
By the way, url ‘/videos/’ chosen for videos by setting option
'rewrite' => array('slug' => 'videos', 'with_front' => false)
in the ‘register_post_type()’ function uses ‘archive-video.php’ as assumed.
I’ve solved this by creating ‘/posts/’ page form admin panel and assigned it custom template called ‘posts.php’. This solution is based on this article http://codex.wordpress.org/Creating_an_Archive_Index.
I always keep this image handy on my computer – I hope it helps you:
I’ve developed with WordPress for a long time and I realize I’m wondering the same thing. The documentation of the archive.php page doesn’t actually address this issue. It should list the url structures that are potentially used by the template page.