My post type is 'licenced-coach'
I have a post form (Post Form > Add New Content) that allows logged in users to create their profile. However, I only want that form to show while the user has not added their profile. Once their profile has been added - I would like to show a link to edit that form.
Is it possible to create a conditional statement something like this:
[if the current logged in user's number of 'licenced-coach' posts = 0] SHOW FORM [end condition]
[if the current logged in user's number of 'licenced-coach' posts >= 1] SHOW EDIT BUTTON [end condition]
Kind Regards,
Orla
Hello,
It is possible with Views, for example, you can create a post view:
- Query 'licenced-coach' posts
- Filter by post author is current logged in user:
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
- In section "Loop Editor":
a) within Views loop <wpv-loop>...</wpv-loop>, display the edit form link:
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/
b) within [wpv-no-items-found]... [/wpv-no-items-found] shortcodes, display add new post form link.
More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-no-items-found
Dear Orla,
I have changed your post to private message, it is not safe to share the credentials publicly.
And I have tried the credentials you provided above, it is not valid, I get this error message:
ERROR: Invalid email address
So, please provide an valid credentials in below private message box, thanks
Thanks for the details, I can see the problem in your website, the author filters does not work in the problem page, the problem is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again
2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
If the problem is fixed, activate other plugins/theme one by one, try to locate the problem plugin/theme
The issue was conflicting custom code - it is resolved now. Thank you!