Skip Navigation

[Resolved] How to edit a draft post and the published post on the same page

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1881993
Loop.png
view.png

Tell us what you are trying to do?
I have created a page where user can publish and unpublish a post on the same page using a edit form with just the submit button.
I have also created a edit post form that publishes the post after editing. The whole thing is done using elementor with a content template assigned to no posts and a post content module.

Now I want to add a draft post edit form on the same page. So, I created a new content template and added a view that only shows draft posts. In that view, I added the edit post form. Then, I added the view on the page. Nothing happened on trying to edit the draft form. The page just load back to itself.

View code:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="loop-item-in-draft-project-submission-edit-post"]
</wpv-loop>
<!-- wpv-loop-end -->
[cred_form form='edit-project-submission-form']
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#1882461

Hello,

I suggest you follow our document to display the edit form link in view's loop:
https://toolset.com/course-lesson/front-end-forms-for-editing-content/
section "Insert link to the Content Template that displays the form"

The workflow is like these:
1) Create a content template, display the edit post form
2) In the view's loop, display the edit form link