Custom pages, alternatives to them being based on 404.php
-
Hi,
I have site with a lot of custom pages that are different from the standard WP posts/pages types.
The pages can all be found in a custom page table in the database. A table that includes urls, titles, etc.
Currently I use 404.php to display the custom pages like this:
1) WP finds out that the current browser url doesn’t match the frontpage or any existing standard WP posts/pages.
2) 404.php is called by WP since the current browser url doesn’t match anything.
3) 404.php checks if the current browser url matches a row in the custom page table (since that table includes the urls of the custom pages).
4) If the current browser url matches a row in the custom page table, the custom page is displayed (with header modifications so the browser, Google, etc. sees it as a normal page and not a 404 page).
5) If the current browser url doesn’t match with anything in the custom page table, the 404.php code is allowed to run as normal (so the user gets a 404 page).Anyone have an alternative to using 404.php for displaying the custom pages?
Using standard WP posts/pages isn’t an alternative as the many, many custom pages will totally pollute the dashboard.
Thanks,
Mads
- The topic ‘Custom pages, alternatives to them being based on 404.php’ is closed to new replies.