Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am following this tutorial to post from front end. I am able to post the title, content, category, tags, I would like to know is it possible to add more fields like in the image below. How to increment field-set? and how to add edit the post from the front end itself?

basically this what I want to do. front end post with advanced fields

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.