[wp-trac] [WordPress Trac] #41626: Template Hierarchy: Custom 404 pages for CPTs

WordPress Trac noreply at wordpress.org
Sun Aug 13 08:12:53 UTC 2017


#41626: Template Hierarchy: Custom 404 pages for CPTs
-------------------------+-----------------------------
 Reporter:  ramiy        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:  template     |
-------------------------+-----------------------------
 Currently theme developers can customize only one error page they can
 design - using the `404.php` file. We can't create custom 404 pages based
 on CPT's. Let's change that!

 WordPress template hierarchy supports CPT's with single CPT pages `single
 -{post-type}.php`, archive CPT pages `archive-{post-type}.php` and embed
 pages `embed-{post-type}.php`. It's missing the option to create custom
 404 pages for CPTs in a form of `404-{post-type}.php`.

 Let's extend the 404 pages with a new template file path:

 * `404-{post-type}.php`
 * `404.php`
 * `index.php`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41626>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list