When an unauthorized visitor tries to access a protected page or post, you can choose from among two things that can happen:
1) Display Error Message: They can be presented with an error message that shows a “lock” image. You can show the standard DAP version, or you can customize this message and add your own text.
-OR-
2) Redirect to Error Page: They can be redirected to any other page of your choice (WordPress page or post, or a completely non-WP page)
1. Display Error Message
Displaying Default Error Message
The default error messages shown by DAP are as follows.
A) If a visitor is NOT logged in, then they will see…
(Image A)
B) If a visitor IS logged in, then they will see…
(Image B)
If you see Image A above, there is a line of text that says: “Click here to get access”.
And in Image B above, there is a line of text that says: “If you are a free member, then click here to purchase access”.
In both cases, the text “click here” is actually a link. And by default, that link will point to whatever you put in the “Sales Page URL” in your DAP Product (to which the above post/page is part of). See Image C below.
(Image C)
Displaying Custom Error Message
If you wish to customize the above standard error messages, then here’s what you need to do:
- Go to /dap/inc/ folder. There are two files there:error-loggedin.php , and
error-notloggedin.php - Make a copy of both files on your computer, and add the text ‘custom‘ to the front of each of the file names of the newly copied files. So the new files are now called: customerror-loggedin.php , and
customerror-notloggedin.php
- Open customerror-loggedin.php and customerror-notloggedin.php and modify them as you please, change the text, formatting, font size, color, etc.
- Upload the new files to the same folder – /dap/inc/ – as the original error files.That’s it. DAP will then ignore the old error files, and start displaying your new “custom” error messages.
2. Redirect to Error Page
Instead of showing an error page (default or custom, from (1) above) you can also redirect the un-authorized user to a completely new page/post of your choice.
If you see Image D below, you will see that on the DAP Products page, there is a field called “Error Page URL“.
By default, this is pointing to /dap/product-error.php
(Image D)
Change this to any link you want. Examples…
http://YourSite.com/myerrorpage.html , or
http://YourSite.com/myerrorpage/
Whatever you put in the above field (Error Page URL) is what page the user will be redirected to, when they access a page that they don’t have access to (either because they have not logged in, or because they are logged in, but don’t have access to it yet).




3 comments ↓
This is so timely Ravi. I’m just running some final tests before I launch my site and had a couple of hurdles to get over. Looks like this could definitely plug one of the gaps.
Great to see the pace of development over here
Also, just a tip for those that switch the lock.gif image with their own: Be sure to adjust your new custom lock image to its proper width and height in the html. This will insure the image is as crisp and clear as it was before loading, which is what I did at
http://lifestoryworkshop.info/members-club-access/
When I go to /dap/inc/ folder, I don’t see those two files there. (error-loggedin.php and error-notloggedin.php)
All I see is a single file called error.php and it only has one line of text that says “This Content Is Not Available To You.”
Leave a Comment