logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$35
post insert form

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

This question has been answered.

attachment image View Attachment

npeplow | 05/28/12 at 2:57pm Edit


The experts have suggested, on average, a prize of $50 for this question.

(4) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    05/28/12
    3:45pm
    Jurre Hanema says:

    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...

    attachment image View Attachment

    • 05/28/12 3:59pm

      npeplow says:

      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

    • 05/28/12 4:00pm

      npeplow says:

      *Jurre, not Viruthagiri

    • 05/28/12 4:59pm

      Jurre Hanema says:

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

  • avatar
    Last edited:
    05/28/12
    3:52pm
    Viruthagiri Thirumavalavan says:

    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.

    • 05/28/12 4:00pm

      npeplow says:

      Hi

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

    • 05/28/12 4:06pm

      Viruthagiri Thirumavalavan says:

      ok then

  • avatar
    Last edited:
    05/28/12
    10:37pm
    Arnav Joy says:

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

    • 05/29/12 1:04am

      Arnav Joy says:

      /*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(); ?>

    • 05/29/12 1:05am

      Arnav Joy says:

      see the screenshot

      Attached Image

    • 05/29/12 1:08am

      Arnav Joy says:

      please find the tr

      Select Shoe Size

      and replace that with

      <tr>
      <td>
      Select Term
      <select name="ecpt_term">
      <option value="Actuarial">Actuarial</option>
      <option value="Audit">Audit</option>
      <option value="Legal">Legal</option>
      </select>
      </td>
      </tr>

    • 05/29/12 7:06am

      npeplow says:

      Thanks - Will be giving this a try later once i'm off work]

      are you sure ecpt_term sets the taxonomy correctly?

      Thanks
      N

    • 05/29/12 7:20am

      Arnav Joy says:

      /*
      If that code not worked then use this code but in this case you have to replace following select box's option value to the term id
      <select name="ecpt_term">
      <option value="term_ID1">Actuarial</option>
      <option value="term_ID2">Audit</option>
      <option value="term_ID3">Legal</option>
      </select>

      replace term_ID1,term_ID2,term_ID3 with the id like 21,22,23 etc..
      let me know if you need any help for this
      */


      <?php
      /* Template Name:companies Form */

      global $wpdb, $user_ID, $post;

      ?>
      /*If that not work then please this full code*/

      <?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',
      'tax_input' => array( 'sectors' => array( $ecpt_term ) ),
      'post_author' => $user_ID,
      );

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



      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 value="Actuarial">Actuarial</option>
      <option value="Audit">Audit</option>
      <option 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(); ?>

    • 05/29/12 3:35pm

      npeplow says:

      Thanks, this worked perfectly

  • avatar
    Last edited:
    05/29/12
    1:36am
    Jatin Soni says:

    There are two plugins called "Post From Site" and "Quick Post Widget" it allow to set Custom Post Type and Taxonomy I used both and both works fine but personally I like Quick Post Widget it has taxonomy drop down selection and support all custom metaboxes while other have selection box.

    Its up to you and your choice which you want to use.

    Links:
    http://wordpress.org/extend/plugins/post-from-site/
    http://wordpress.org/extend/plugins/quick-post-widget/

    Previous versions of this answer: 05/29/12 at 1:36am

This question has expired.



npeplow had additional discourse to offer.

npeplow voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.