it's unclear which template file is used by custom post types
|Reported by:||danielpataki||Owned by:|
Hello! I'm not sure this is a problem, it's more a case of bad usage practices on my end, but perhaps something that count be addressed.
I'm using post_types to create sections on a blog. For example, you could create a Yahoo Answers type forum by creating a post type named "questions". I named it in the plural because I want to have a nice permalink style, so I created a page named "questions" and some sub-pages like "most-recent", "most-commented".
In this case however, the template pages used by wordpress are a bit mixed up. page.php is used to display the main section page, which is blogurl.com/questions/ , single.php is used to show a question single post, blogurl.com/questions/the-title-here, but for subpages, index.php is used, while it should be page.php.
I did not check how the function works, but I am guessing that since there is a post_type named "questions", wordpress assumes that "most-viewed" is a post as well. When it doesn't find it, it falls back on index.php.
Again, I think this is probably not good practice, I'm just bringing this to attention so maybe I can help a bit.
Change History (5)
- Component changed from General to Template
- Milestone changed from Unassigned to 3.0
- Severity changed from normal to major
- Summary changed from post type and page name problems to it's unclear which template file is used by custom post types
- Type changed from feature request to defect (bug)
- Version set to 3.0