#12358 closed defect (bug) (invalid)
Sub pages aren't handled by page.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 3.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I am not sure if this is a bug, could be something I overlooked, but here is the situation.
I have created 6 main pages (no parent), and one page has 5 sub-pages. When viewing them, it is apparent that the main pages are handled by page.php as usual, but sub-pages are handled by index.php.
I do not have anything which would be working to override the wordpress built in stuff that handles this. I do have a custom post type for the pages, but I doubt that these would be causing any problems, as main pages assigned the custom post type are displayed correctly.
I do hope I am helping here, I will double check yet again and comment here if I find that this is my stupidity.
Change History (8)
comment:1
danielpataki
— 3 years ago
comment:2
dd32
— 3 years ago
I do not have anything which would be working to override the wordpress built in stuff that handles this. I do have a custom post type for the pages, but I doubt that these would be causing any problems, as main pages assigned the custom post type are displayed correctly.
Do these have a post_type != "page"? Or were you refering to Taxonomies?
For me, This is working.. The sub pages are handled by page.php AND is_page is true. Can you disable ALL plugins, and try on a stock install? If you can find something which triggers it, it'd be much easier to diagnose.
/about/ => is_page() == true /about/sub-child/ => is_page() == true
comment:4
danielpataki
— 3 years ago
- Keywords reporter-feedback removed
Sorry about that, I was very unclear. I meant that there is a custom taxonomy implemented, not a custom post type. The post type for both main pages and sub pages is "page", I checked in the database as well, not just with functions.
The install is a completely clean one, apart from a plugin I wrote myself. I deactivated it just to make sure, and the problem persists.
The wordpress build itself is a nightly I downloaded a week ago of Wordpress 3.0, shall I try with the most recent nightly build?
comment:5
danielpataki
— 3 years ago
- Keywords reporter-feedback added
comment:6
dd32
— 3 years ago
- Keywords reporter-feedback removed
- Milestone changed from Unassigned to 3.0
updating to the latest nightly would be ideal, Whilst i havnt heard of that bug, It definately pays to update as it changes quite often daily lately :)
Are you using URL Rewritten permalinks? or just ?page_id=dd?
comment:7
danielpataki
— 3 years ago
- Resolution set to invalid
- Status changed from new to closed
Ok, I think you might have found the problem :) I was using url rewritten permalinks, and just to check, I switched back to the default.
This not only resolved my problem when using the default structure, but also resolved it when I switched back to the url rewrutten structure.
I am now trying to think hard how I did things when setting up the blog, because the following scenario is frequent with me. When I am tasked with redesigning a blog for example, I set up wordpress locally, export the sql database, in a text file I search for the original url and replace it with the new one. I then import the database and tie it to the test blog. This works without fault, but there is one thing I always have to do to make permalinks work because if I don't each link points to a permalink, but in fact goes to an error page. The way I resolve this is switch back to the default view and then back to the rewritten structure. Obviously this happens because I don't copy the htaccess file from the original, so wordpress recreates in when I switch to the default view and back again.
However, in this instance I did a completely new install, I don't recall any database imports, or anything like that. However, I am inclined to say that this error was caused by myself, so I think it should be set to invalid, which I have done. If I see this happening again under more controlled circumstances I will report it again, sorry for wasting your time and thanks for helping out!
Also, I just did a check, and sub-pages aren't recognized as pages by the "is_page" function. I deleted my page.php, which means that now pages are handled by index.php. I then checked with is_page() and only the top level pages are recognized as pages