PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Creating an Interview Form With Results Automatically Submitted To A Post

  1. Hi all. I'm using WP 2.9 and Thesis 1.6. I want to set up an interview form where readers answer questions about their cars - 10 fields in all. I want the results to appear as a draft post in WP and after review I publish them as a post.

    I've tested the post fields and they work. However I only have the option of one Body Field and not 10. I'm thinking I need to use Custom Fields but I'm unsure as to how to make them appear as a draft post. I've been playing around with this all weekend and not succeeded. Can anyone point me in the right direction?

    BTW I'm a newbie and don't have any real coding chops but I'm willing to give it a shot. The blog is at http://blog.autostarsuperstore.com if this helps. There's no forms up there yet though.

    Any help would be much appreciated!

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  2. You could create a seperate post field for each question and then have a different custom field name for each answer.

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  3. I do a lot of interviews so this would be good to do for my website as well.

    If I make each a custom field how do I then take them all and put them into the body?

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  4. This code should work. The example below would show the naswer to question 1 only if it is answered, if not it would not show either the question or the answer.

    <?php if( get_post_meta($post->ID, "question_1", true) ): ?>
    <b>Text of Question 1: </b><?php echo get_post_meta($post->ID, "question_1", true); ?>
    <?php else: ?>
    <?php endif; ?>

    I place the code above where you should find something that looks like this:

    <?php the_content; ?>

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  5. In what file would that go though?

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  6. single.php if it is a post or page.php if it is a page

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  7. This is going to be different with Thesis because it uses it's own template system, it doesn't use standard WordPress templates. It has to be done with hooks and a custom function file.

    What you will want to do is try posting on the diythemes.com support forums to get help with how to output custom fields on a post page. It's more complex than standard WordPress themes. Typically you would just add that code to your themes functions.php file, but Thesis is different.

    Posted 9 years ago on Monday May 3, 2010 | Permalink
  8. Thanks Carl, I'll try that.

    Posted 9 years ago on Tuesday May 4, 2010 | Permalink
  9. Thanks Carl!

    Posted 9 years ago on Tuesday May 4, 2010 | Permalink
  10. Best to listen to somebody who actually knows how it works :o)

    Posted 9 years ago on Wednesday May 5, 2010 | Permalink
  11. Hehe... I was just in the DIY Themes forum looking for the solution to this exact answer. Still no answer there. If anybody finds a solution to this, please share! Thanks!

    PS- Love the plugin!

    Posted 9 years ago on Wednesday May 5, 2010 | Permalink