Post & edit a post from front end along with upload, dropdown, and other inputs

I believe it is better if you use the ajax method instead of sending the POST to the same page.

You can use javascript to increment the form / fieldset. Use an array for the name e.g

<input type="text" name="ingredient[]"/>

If you want to edit the post, just you us the saved data on the value attribute, e.g

<input type="text" name="ingredient[]" value="<?php echo get_post_meta($post->ID, 'ingredient[0]', true) ?>"/>

If the post meta using a same meta_key, just put it in the for each loop.

Hope this help

Leave a Comment