Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 7 years ago

#10486 closed defect (bug) (duplicate)

404 Template Pages

Reported by: dcole07 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8.1
Component: Template Keywords: needs-patch
Focuses: Cc:


There is something wrong with how WordPress desides whether to use the 404 template or not. There are a lot of cases where it uses other templates went there is not content.

How to reproduce:
Install Wordpress 2.8.X
Use the Default theme
Go to ?p=404 or any made up page that isn't real.
It doesn't go to the 404 template, which it should. It instead uses the single template, even though there is no content.

Themes can do a work-a-around by using an if/else statement and checking for content, but that's dumb, when we have a is_404() check. WordPress should default to using 404.php (if there is one) and make is_404() true before any template file is loaded.

If this is how the core developers want the 404 to work, then another template and template functions should be made, so people can have one template to manage URLs that don't have content.

Change History (6)

#1 @dcole07
12 years ago

This might be a dup of: Ticket #10191

#2 @dcole07
12 years ago

  • Keywords needs-patch added

To summarize this problem, WordPress is able to find a template based on URL information, but it turns out to be the wrong template, because there is not content.

#3 @dcole07
12 years ago

I'll pick up this ticket or the one it's a dup of, if no one else will and someone is willing to mentor me or give feedback to my ideas. I'd like to suggest a solution, but I don't know enough about the WordPress template system at the moment... I'll look into it.

#4 @dcole07
12 years ago

I read though the WordPress code and it's not like the code has a bug, it's just lacking the feature to pickup on missing content. The problem with generating a solution for this "bug" is that we don't know there is no content until we're half way though the template it did match. What I don't get, is that this problem can be avoided with the right non-default permalink structure. So, does that mean we can patch this problem, so visitors don't use a template that doesn't have content available? I'm thinking we could check for content based on what the URL says it's going to be when WordPress is deciding what template to use and give a 404 if nothing is found... basically. We'd have to be careful, because some templates may be designed to not have content.

#5 @janeforshort
12 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

#6 @DrewAPicture
7 years ago

  • Milestone 2.9 deleted
Note: See TracTickets for help on using tickets.