WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have requirement More then one field in registration form which i have build as above but there is some problem and it will not insert in wp-post table.

                                        if(isset($_POST['submit']) ){

                                            global $wpdb;   // to connect a database 

                                            //store array arg in database
                                             $custompost = array('post_status' => 'publish', 'post_type' => 'post', 'post_author' => $user_ID,
                                                            'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
                                                            'menu_order' => 0,'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0,
                                                            'post_name' => $_POST['name'], 'post_designation' => $_POST['designation']



                                                 $postId = wp_insert_post($custompost);


                <div id="postbox">
                            <form id="new_post" name="new_post" action="" method="post" >
                            <table border="0">  
                                    <td><h2>Registration Form</h2></td>

                            <tr><td><label for="name">Name:</label></td>
                                <td><input type="text" id="name" value="" tabindex="1" size="20" name="name" />

                                <td><label for="designation">Designation/Class:</label></td>
                                <td><input type="text" id="designation" value="" tabindex="1" size="20" name="designation" /></td>
                                <td><label for="sex">Sex:</label>               
                                <input type="radio" name="gender" value="male">Male
                                <input type="radio" name="gender" value="female">Female</td>

                                <td><label for="organization">Organization:</label></td>
                                <td><input type="text" id="organization" value="" tabindex="1" size="20" name="organization" /></td>

                                <td><label for="postaladdress">Postal Address</label></td>
                                <td><textarea id="postaladdress" tabindex="3" name="postaladdress" cols="25" rows="3"></textarea></td>

                                <td><label for="telephoneoffice">Telephone Office:</label></td>
                                <td><input type="text" id="telephoneoffice" value="" tabindex="1" size="20" name="telephoneoffice" /></td>
                                <td><label for="mob">Mob:</label>
                                    <input type="text" id="Mob" value="" tabindex="1" size="20" name="mob" /></td>

                                <td><label for="emailaddress">Email Address:</label></td>   
                                <td><input type="text" id="emailaddress" value="" tabindex="1" size="20" name="emailaddress" /></td>

                                <td><label for="academicqualification">Academic Qualification:</label></td>
                                <td><input type="text" id="academicqualification" value="" tabindex="1" size="20" name="academicqualification" /></td>              

                                <td><label for="experience">Experience Teaching / Industry:</label></td>    
                                <td><input type="text" id="experience" value="" tabindex="1" size="20" name="experience" /></td>

                                <td><label for="titleofpaper">Title of Paper(s)</label></td>
                                <td><textarea id="titleofpaper" tabindex="3" name="titleofpaper" cols="25" rows="3"></textarea></td>

                                <td><label for="participationas">Participation as:</label></td>
                                    <option value="faculty">Faculty</option>
                                    <option value="research">Research Scholar</option>
                                    <option value="under">Under Graduate Student</option>
                                    <option value="industrial">Industrial Participant</option>
                                    <option value="participant">Participant Outside India</option>

                                <tr align="center">
                                <td colspan="2"><button type="submit" name="submit">Submit</button>
                                    <input type="hidden" name="submitted" id="submitted" value="true" /></td>


            </div><!-- end #content -->

            <?php get_footer(); ?>

I am referred codex but no one idea about more then one field insert as post so suggest me if you have any ans.

Thank You.

share|improve this question
I would recommend you convert these to user meta fields instead of inserting as post. – Angela Jul 26 '13 at 12:34
@Angela can you suggest me any example ? – Ravi Parmar Jul 26 '13 at 12:43
Could you please reformat your code? It's completely off and tough to read (hit the "edit" link on the bottom left of your question). Thanks. – kaiser Jul 26 '13 at 13:29
Oh, btw, as I've seen the wordpress.com: Is this question really about wordpress.com? – kaiser Jul 26 '13 at 13:29

Instead of treating the content as a post. It's best to let them be users as they originally were. So you should hook custom user meta field into the registration form instead. Please see this article for information on how to do that http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields

share|improve this answer

Your Answer


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.