Skip Navigation

[Resolved] Custom edit post page

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to display an edit post Form in a custom Page, not a Content Template. I would like to create a custom Edit Post link to this Page so that the correct post is edited in the edit post Form.

Solution: It is possible with some limitations. You can create your own edit post page and style it however you want with headers and footers. Next, create a View of this specific post type. Add a post ID filter, set by a URL parameter.

Now place your edit post Form in the loop of the View, and place the View in your edit post page. Now you can create a custom edit post link in a View of posts using the post ID and post title shortcodes, like this:

<a href="/your-edit-post-page/?post_ids=[wpv-post-id]">Edit [wpv-post-title]</a>

A few limitations here:
- The View must not have filters or pagination
- The View must not use AJAX
- The Form must not use AJAX
- The built-in "edit post link" cannot be used here, only a custom link like the one shown above.

100% of people find this useful.

This support ticket is created 5 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Simon Logan 5 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1392409

I have built a view which lists the user's posts within a certain custom post type and have included an "edit post link" placeholder into it which then links through to the edit post form I've built, pre-filled with the details of the particular post being edited - so that's all fine.

The only issue I have is that since this edit page isn't a page i've created I've got no direct control over its design meaning that my main site header is missing. I'm using Elementor so whilst I can create header template and assign it using conditions, there are no conditions to match the "edit post" page.

Is it possible for me to create my own EDIT POST page, then to allow that post listing to link to my edit page instead (somehow passing the ID param of the given post) rather than using the default one? I could create page using elementor then embed the edit form within that page, I'd just need a way to adjust that edit link to go to my page instead.

#1392663

It's possible, with some limitations. You can create your own edit post page and style it however you want with headers and footers. Next, create a View of this specific post type. Add a post ID filter, set by a URL parameter. See the screenshot here for an example. The "post_ids" parameter name is arbitrary, so you can make it something else if you'd like.

Now place your edit post Form in the loop of the View, and place the View in your edit post page. Now you can create a custom edit post link in a View of posts using the post ID and post title shortcodes, like this:

<a href="/your-edit-post-page/?post_ids=[wpv-post-id]">Edit [wpv-post-title]</a>

A few limitations here:
- The View must not have filters or pagination
- The View must not use AJAX
- The Form must not use AJAX
- The built-in "edit post link" cannot be used here, only a custom link like the one shown above.

#1395295

Thanks for this, I knew something like this should be feasible, just wasn't sure how best to achieve it and I think it was the insertion of the edit form into the loop which was the missing piece of the puzzle for me.

I didn't see the attachment to which your reply referred and needed to guess at a couple of settings when getting things set up but have managed to achieve what I was looking for now, so thanks for that.