I am trying to: allow users to edit custom post types from the front-end.
I created a form to create new posts and another form to edit posts (CPT).
I created a page that embeds the form to add new posts (CPT).
I created a layout for the archive of the CPT where users can click on the name of the post to see it.
I created a layout for the "single" CPT. In this layout, I used the CRED button to insert a link to the "Edit Form".
I visited this URL:
When clicking on the Edit link this is added to the URL: ?cred-edit-form=44857&_id=45708
I expected to see:
The edit form...
Instead, I got:
I am still on the "single" page where I can see the post in "view mode". The link still has the "?cred-edit-form=44857&_id=45708" part, the edit button doesn't show if that part is in the URL.
Hi, is it possible that the edit form is hidden further down the page, underneath the post content? By default, Layouts will load the CRED edit form on the single post page, with the content of your post visible. If you want to modify that, so that the edit form appears on its own page, I can help set that up. If the edit form is not visible at all on your page, that's an issue I will need to investigate further. Can you clarify for me if the form is completely missing, or just hidden?
Hi Christian,
thanks for your reply. I have just double-checked - just in case - and I can confirm that the page is reloaded, the Edit link disappear, but no edit form is shown.
Thanks,
Mirko
Okay that's unusual.
- Does this problem occur for only certain users, like only logged-in users, or only logged-out users? Any certain user role?
- If you are using Toolset Access, can you confirm the user has the ability to edit the post?
- Can you disable any non-Toolset plugins and enable a default theme like Twenty Seventeen temporarily to test?
If none of these tests reveal the problem, I will need to take a look at your wp-admin area to see your site configurations. You can provide the login credentials in the private reply fields here. Please also let me know where I can find the edit form (full URL). Thanks!
Hi Christian,
The problem occurs with both the Administrator and the custom role I created for the users (after making sure that Access was configured properly).
I have tried with a default configuration: the only thing that changes is that disabling Divi when I click on the Edit link I am redirected to the edit page but in the Dashboard rather than the front-end.
Disabling all the plugins (but the SiteGround plugin) doesn't change anything. I will send you a private reply with the log-in information and the URL.
Thanks
EIDT: I cannot find the private reply fields you mentioned in your message. Where are they? O:-)
Yes, please send the login credentials. There should be private fields enabled for your next reply.
Okay I see what's happening. You are using a Layout to display the single "Listing" post. CRED forms use the WordPress hook 'the_content' to display the CRED form for editing post, but your Layout does not include a cell that initiates a call to the_content. You can fix this by adding a content template cell in the single project Layout.
Insert this code in the content template cell:
[wpv-post-body view_template='None']
Please let me know the results.
Hi Christian,
no luck, I am afraid...
I added the cell as per your instructions (maybe it has to be in a specific place?) but the behaviour of the Edit link is still the same (page is reloaded, edit link is no longer there, but the edit form does not show up).
PS: Attaching a pic to show the cell in the layout. I can see that cell in the code of the page but it is completely empty (second pic attached).
Okay, I can't see anything obviously wrong here so I would like to make a clone of your site I can test locally. This way I can modify code without breaking your live site. Please let me know if that's okay with you, and I will use the Duplicator plugin to create the clone and proceed with my tests.
Duplicator plugin: https://wordpress.org/plugins/duplicator/
Hmmm, I just disabled all the non-Toolset plugins and now I see the CRED edit form on my local environment. I'm attaching a screenshot.
I'll try to narrow down the conflicting plugin, standby.
It's Yoast SEO - when I disable the Yoast plugin temporarily on my end and purge the cache, my form reappears. Can you confirm the same on your end? I'm closing out the day here but I'll be back online Sunday. If you need urgent support before then, feel free to open a new ticket and link to this one for reference.
Great, yes, I can confirm that deactivating Yoast SEO the problem is gone!
Thanks for your support and have a great weekend.