hi there,
I have a "create camp" form that is supposed to be hidden from guest users. If i press "Opret camp" in the header it works perfectly - the user is being redirected to the page with the login form if they are not logged in.
But if i link to the "create camp" form on another place on my page - let's say a simple link in a text - the link shows the page with the create camp form instead of redirecting to the login form. Is it possible to make the entire page with the create camp form hidden for guest users?
When a logged-in user visits this page, the form to add a new camp is showing and the guest visitors see the "Page not found" message.
Now, to show a login form to these guest visitors instead, you can create a new content template and insert the login form in it. After that, you can select it to be shown when "not allowed" in the settings of the post group "Logged in only".
I'm afraid, there is no option available in the post group restriction settings to redirect visitors to a different page. But the steps suggested in that guide from my last step are fairly simple too.
1. You'll create a new content template with a name something like "Template With Add New Camp Host Form", from WP Admin -> Toolset -> Content Templates.
In the content of this template, you'll only need the user form named "Camp host" (that you also have on the /signup-host/ page).
2. After that, you'll go to WP Admin -> Toolset -> Access Control -> Post Groups, and in the no access settings for the "Guests" under the "Logged in only" post group, select this newly created content template from step 1.
( screenshot: hidden link )
As a result, if guests will try to visit the /welcome-host/ page ( or any page with the "Logged in only" post group ), they'll see the "Camp host" form and not the regular content that is shown to logged-in users.