vendredi 2 janvier 2015

Can we have a php "page" without a WordPress "page"?


Somewhere off of the homepage we need to show a container page which does some stuff with custom post types. Actually it doesn't matter what it does, my point is it needs to exist and be reachable from the homepage menu.


We have done this before and created a WordPress "page" to operate as a container page and then in the theme/backend/PHP created a page-xxx.php which is where all the work of being a container happens and that ... sort of ... works.


But it does mean there's this useless "page" in the WordPress admin menu, which we have to instruct the client not to edit as "it's not a real page, just a placeholder" and mostly that's fine. But it's not ideal.


I know we can hide the placeholder page from the client. But is there a less kludgy solution?


Can we have a page in PHP with code to do a specific job and be able reach that code as a slug/address without actually the page existing as a page in admin?





Aucun commentaire:

Enregistrer un commentaire