Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

post insert form WordPress

  • SOLVED

Well, hello

I am starting a graduate careers website, this lists company profiles that are currently pre written in text format. I intend to get amazon mecanical turk workers to help me do the manual grinding of importing (copy paste the text) of these as there are 100's. Instead of them having to login and create new posts, I would like to have a page with a form that can be used to insert new posts

The following attributes are required

Page to have a custom post type
post_type=companies

Page to have a taxonomy set that is selected from a drop down, values can be hard coded (for example - Actuarial, Audit, Legal
taxonomy=sectors

*Page content
Title - free entry text field that sets the page title

Content - this is *not* set, the page content is from the meta fields

*Meta Fields
The following meta fields are multi-line text boxes

Overview - ecpt_overview
Graduate - ecpt_graduate
Internship - ecpt_internship
Conclusion - ecpt_conclusion

The following fields are single line text boxes

Careers Homepage - ecpt_careershomepage
Logo - ecpt_logo

Submit button once clicked should return a confirmation message

attached is a rough screenshot of the wordpress back end, to give you a general idea of the fields

I really dont care that much about the formatting

Answers (4)

2012-05-28

Jurre Hanema answers:

I hacked this plugin together from some bits I had lying around. Upon activation, it creates a page "Add company profile". Users do not have to login in in order to create a post using that page.

Give it a go, it might just work...


npeplow comments:

Hi Viruthagiri

I have installed your plugin to my staging environment, it adds the page correctly - but seems to have broken the website, most pages now return a 404 error

Tried setting the permalinks again, but its the same issue


npeplow comments:

*Jurre, not Viruthagiri


Jurre Hanema comments:

Hm. That's strange. Unfortunately I don't think I can fix it because for me, locally, everything works as it should...

2012-05-28

Giri answers:

Hello npeplow,
I understand all your requirements. I would like to suggest a plugin which will satisfy all you needs.
Plugin name is "Magic fields". Version 2.0 supports all type of fields. I'm using this plugin for more than a year and i'm very satisfied with this plugin.
Its free.. Here is the official site. http://magicfields.org/

I requested front end posting form 2 months ago. Now magic field has front end posting feature too. You can read our conversation here. https://github.com/gabor-udvari/Magic-Fields-2/issues/1

Just download the files from here. https://github.com/gabor-udvari/Magic-Fields-2/zipball/fork
If you need documentation check this page... http://wiki.magicfields.org/doku.php?id=magic_fields_v2.0

If you use this plugin, you don't have to depend on the programmers in the future.. So just try this plugin... Good luck. If you have any questions let me know.


npeplow comments:

Hi

I am already using a plugin to create the custom fields, would rather not add another - thanks for the suggestion though


Giri comments:

ok then

2012-05-29

Arnav Joy answers:

can you please tell that Actuarial,Audit... etc. are taxonomies or term of a taxonomy


Arnav Joy comments:

/*To use this code copy full code and create php file eg. myfile.php
paste all the code then create a page a select its template as companies Form from the drop down the view this page and see.*/
<?php
/* Template Name:companies Form */

global $wpdb, $user_ID, $post;

?>
<?php
if(isset($_POST['submit'])) {

$ecpt_title = $_POST['ecpt_title'];
$ecpt_term = $_POST['ecpt_term'];
$ecpt_overview = $_POST['ecpt_overview'];
$ecpt_graduate = $_POST['ecpt_graduate'];
$ecpt_internship = $_POST['ecpt_internship'];
$ecpt_conclusion = $_POST['ecpt_conclusion'];
$ecpt_careershomepage = $_POST['ecpt_careershomepage'];
$ecpt_logo = $_POST['ecpt_logo'];



$ecpt_data = array(
'post_title' => $ecpt_title,
'post_content' => '',
'post_status' => 'draft',
'post_type' => 'companies',
'post_author' => $user_ID,
);

$insert_id = wp_insert_post( $ecpt_data );
if($insert_id > 0) {

wp_set_post_terms( $insert_id, $ecpt_term, 'sectors', $append );

update_post_meta($insert_id, "ecpt_overview", $ecpt_overview);
update_post_meta($insert_id, "ecpt_graduate", $ecpt_graduate);
update_post_meta($insert_id, "ecpt_internship", $ecpt_internship);
update_post_meta($insert_id, "ecpt_conclusion", $ecpt_conclusion);
update_post_meta($insert_id, "ecpt_careershomepage", $ecpt_careershomepage);
update_post_meta($insert_id, "ecpt_logo", $ecpt_logo);


}

}
?>

<?php get_header(); ?>

<div id="container">
<div id="wrapper">
<div id="content">
<div class="pages" style="min-height:500px">
<form name="user_form" id="user_form" class="user_form" method="post" action="" enctype="multipart/form-data">

<table width="45%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" class="text" name="ecpt_title" value="" size="40" placeholder="<?php esc_attr_e( 'Enter Company Title', 'comp' ); ?>" /></td>
</tr>

<tr>
<td>
Select Shoe Size
<select name="ecpt_term">
<option <?php if($size == "5") echo 'selected'; ?> value="Actuarial">Actuarial</option>
<option <?php if($size == "5.5") echo 'selected'; ?> value="Audit">Audit</option>
<option <?php if($size == "6") echo 'selected'; ?> value="Legal">Legal</option>
</select>
</td>
</tr>

<tr>
<td><textarea class="text" name="ecpt_overview" rows="5" cols="31" placeholder="<?php esc_attr_e( 'Enter Overview', 'comp' ); ?>"></textarea></td>
</tr>

<tr>
<td><textarea class="text" name="ecpt_graduate" rows="5" cols="31" placeholder="<?php esc_attr_e( 'Enter Graduate', 'comp' ); ?>"></textarea></td>
</tr>

<tr>
<td><textarea class="text" name="ecpt_internship" rows="5" cols="31" placeholder="<?php esc_attr_e( 'Enter Intership', 'comp' ); ?>"></textarea></td>
</tr>

<tr>
<td><textarea class="text" name="ecpt_conclusion" rows="5" cols="31" placeholder="<?php esc_attr_e( 'Enter Conclusion', 'comp' ); ?>"></textarea></td>
</tr>

<tr>
<td><input type="text" class="text" name="ecpt_careershomepage" value="" placeholder="<?php esc_attr_e( 'Homepage', 'shoes' ); ?>" /> </td>
</tr>
<tr>
<td><input type="text" class="text" name="ecpt_logo" value="" placeholder="<?php esc_attr_e( 'Logo', 'shoes' ); ?>" /></td>
</tr>


<tr>
<td>
<input type="submit" name="submit" value="Submit" />
</td>
</tr>

</table>

</form>

</div>

</div>

<div class="clear"></div>

</div><!-- wrapper -->
</div><!-- container -->

<?php get_footer(); ?>


Arnav Joy comments:

see the screenshot