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.

Make "post name" field be "post author" for non-registered

  1. comunitae
    Member

    hello,

    i've already gone through the forum with no success.
    My case: One form for non-registered users to submit content. in the form i have chosen a default user as people who submit the information are non-registered users.

    i'd like to show in my wordpress theme not the default author but the name of the person who submitted the content and who filled the field "name" instead of the default user, as the content is not submitted by the default author.

    there are 2 options: (i) use the registration add-on that allows you to submit content+ make the user who submits the content the "author". it's quite straightforward BUT, if the user comes again and wants to submit new content, it's not possible in that form as a validation message pop up due to his email/username already exist!. I don't want to give users acces to the backend or create another form for registered users.

    another option i've read is to change after submitting the form using gform_post_submission hook.

    i'm very junior in gravity and i'll appreciate a very "simple" and an example so than i can either
    (a) show the Name (field Name) given in my template or
    (b)modify the default author and change it to "the_name_given_author" so that my template shows the updated author modified

    thanks

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  2. David Peralty

    Here is the easiest answer I can think of. Store the name of the user in a custom field, and then in your WordPress theme, change it to display the value of the custom field. Then whatever their name is shows up where the post author would normally go. Would this solution work for you?

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  3. comunitae
    Member

    hello david thanks for the reply
    i'm very junior in gravity forms

    i.- how do i make that custom field?
    2.- what would the code to show the value of the custom field?

    thanks

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  4. David Peralty

    Under the post fields, there is a custom field field option. You will want to use this. Then any post created by Gravity Forms will have a custom field value you can pull from.

    After this, it is all WordPress theming and has nothing to do with Gravity Forms. Depending on your theme, you'll have to do different things.

    Here is all the documentation on custom fields from WordPress -
    http://codex.wordpress.org/Custom_Fields

    You might want to reach out to the creator of your theme and ask them for any help customizing the theme to display the custom fields if you don't feel confident you can do it.

    This is the best way to do what you want though. All my best!

    Posted 11 years ago on Monday December 10, 2012 | Permalink
  5. comunitae
    Member

    hello,

    added a custom field, which label is "Your name"

    haven't ticked any other option, just changed the label.

    when tried to display the custom field on wordpress dinamically (for each entry, show each name of each person who submits the content...) i have tried unsucesfully:

    <?php $key="Your name"; echo get_post_meta($post->ID, $key, true); ?>

    get_post_meta($post_id, $Your_name, $true);

    i know i'm close but it's not working. could someone give a hand?
    don't how to pull the custom field data

    thanku

    Posted 11 years ago on Tuesday December 11, 2012 | Permalink
  6. Can you post a screenshot of the MySQL database record for where this "Your name" field is being stored? Once we can verify the meta key exactly, then we can move on the echoing that value in your post template.

    Please use one of the free image hosting services to share your screenshot and paste the link here.

    Posted 11 years ago on Thursday December 13, 2012 | Permalink
  7. comunitae
    Member

    hellos chris, thanks for the support

    the value is stored in the table wp_rg_lead_detail
    the custom field is field 11

    please find attached the form and the mysql snapshot
    http://www.freeimagehosting.net/jzk3x
    http://www.freeimagehosting.net/pvlr8

    i don't know (i) if there is something wrong in the form and what code need to be used in my wordpress template.

    lots of thanks for the support

    Posted 11 years ago on Sunday December 16, 2012 | Permalink
  8. comunitae
    Member

    please, can you give me support? thank you

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  9. comunitae
    Member

    not happy with the support so far :(

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  10. David Peralty

    Due to our release of a new version and our Quiz add-on, support requests have been higher than normal, and requests related to Gravity Forms issues get priority. Have a look at this tutorial for displaying a custom field outside of a WordPress loop: http://www.wpbeginner.com/wp-themes/how-to-display-custom-fields-outside-the-loop-in-wordpress/

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  11. I got a malware warning in Google Chrome when trying to visit the image hosting site to view your screenshots. Sorry I could not see the images to be able to help you further.

    Posted 11 years ago on Friday December 21, 2012 | Permalink