Has anyone added functionality to allow a page to be unpublished? We have a site that is ready to go live, except for one page that doesn't have approval yet. I know we could hide it from the navigation, but is there anyway to unpublish it so it won't show up unless you're in the back end?
Unpublish pages?
- ashafer
- Thread is marked as Resolved.
-
-
Yes, you can do this with page attributes and a little bit of PHP: https://grabapipit.com/blog/drafting-at-the-page-level
If you prefer to write less PHP you can install the Pipit app and use the pipit_perch_user_logged_in() function:
If you are using Runway, you can use your 404 page like so:
I don't think you can use PerchSystem::use_error_page() on standard Perch. You can redirect to the 404 if you're ok with that. This doesn't respond with a 404 code though.
Or you can use PHP's http_response_code() to set the HTTP response code and then output you not found message:
-