查看文章 |
Most 404 templates in WordPress themes suck. They generally read something like “404 Not Found” and give an extra sentence or two about an error. This is totally unnacceptable to a site visitor that comes across a 404 page.
A site’s 404 page should be unique and reflect what the site owner(s) want. It’s tough for theme developers to know how to create a 404 page since they’re making a theme for thousands of people. The question becomes: How does one create a 404 template that users can customize from within the WordPress admin? I’m going to show you an extremely simple technique that’ll make both theme developers and users’ lives easier. We will widgetize our 404 templates from this day forward. Oh, and by the way, the Hybrid theme already uses this method. Really, did you expect anything less from the coolest theme ever? Register your 404 widget area with WordPressLike any other widget area, we need to let WordPress know about it. Open your theme’s
If you’re releasing this theme publicly, you should localize the widget area Displaying the widget area on your 404 pagesOpen your theme’s
It’s as simple as that. Now you can edit your 404 template at any time without having to open your theme files. |

