I was wondering how would I go about overiding wordpress’s default 404 on private pages when not logged in? Had a look around at post-template.php however nothing I could change that made it work?
Leave a Reply
You must be logged in to post a comment.
to create custom message for private pages
add this code to the top of your 404.php in your theme:
I’m not 100% sure I understand what you’re asking, but it sounds like you want to create a custom 404 page and change that depending on whether someone is logged in or not.
To do that: create a
404.php
file and upload it to your theme directory (the same theme directory with theheader.php
,footer.php
,sidebar.php
, etc). Then, in the code, use this function:That should do it it for you.
Sources: Creating an Error 404 Page, Function – Is user logged in