Hi
I've just starting building a new site that requires a my account page (hidden link). If a guess views the my account page then it should display a login form.
I've basically followed these instructions: https://toolset.com/course-lesson/creating-custom-login-forms/#building-a-layout-using-a-login-form but if I view the my account page it displays the page content rather than the login form. If I change the what to display for a single-posts when there is no read permission to show 404, then it will show the 404 page so its only the show content template that isn't working.
I've created this on another site with no issues so i'm not sure what im missing. I've attached an image of my content template with doesn't seem to be working.
Also i've added My Account to the menu and that only show if i'm logged in as admin so the access control part is working.
Cheers
Aaron
Hello,
The document you mentioned above is using Toolset content template, please follow our document to check if your theme supports Toolset content template:
https://toolset.com/documentation/programmer-reference/theme-support-for-content-templates/
Hi
Yes the theme uses the the_content function. I also tried switching to one of the default WordPress themes but no luck.
Here is a sandbox website:
Login URL: hidden link
Detail steps:
1) Create a content template "Guest CT":
hidden link
Display login form shortcode: [wpv-login-form]
2) Creaet a post groups "Logged-in-only", disable "Read" permission to "Guest" user role, and display above content template:
hidden link
3) Create a page "My account":
hidden link
Choose above post groups "Logged-in-only"
Test it in frontend as guest:
hidden link
I can see it works fine, I see the login form correctly, can you reproduce the same problem in above sandbox website?
Hi Luo
Thanks for setting up the sandbox site.
I was able to replicate the issue on the sandbox site by changing the theme to Twenty Twenty-three.
On my site I installed the Twenty Twenty-One theme and the login displayed correctly for logged out users. Not sure why it isn't working for recent themes?
Hi Luo
I've managed to work out what the problem was. I changed my theme to the parent theme and it worked so I knew there must be an error in my child theme. When I checked to see if the theme was the problem the other day I changed it to the Twenty Twenty-three theme and when that didn't work either I thought it must not be a theme issue.
Anyway I was missing the while have posts loop in my page.php file, so a silly mistake. I'm not sure why it doesn't work with the Twenty Twenty-three theme though.
Thanks for taking time to look at this.
Cheers
Aaron
My issue is resolved now. Thank you!