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.

Post Image path

  1. Tmeister
    Member

    Hello.

    I recently purchased a license and am trying to do a form to create a new post.

    Everything works fine, custom fields, title, excerpt etc etc.

    The problem is: I can not find how to get the path of the image (Post Image), I found the image in $ PATH.../wp-content/uploads/gravity_forms/1/2011/05/image.png

    How do I find this path for use in a custom template, not in post body, in a template?

    For custom fields use:

    $custom = get_post_custom ($ post-> ID);

    Thanks in advance

    Posted 14 years ago on Monday May 16, 2011 | Permalink
  2. This isn't really a Gravity Forms questions, it's a WordPress theming question.

    That path is not the path to the image in the Media Library. That is the path to the original image uploaded. When you use the Post Image field it adds the images to your Media Library and attaches it to the post that is created. This is no different than uploading an image in the Edit Posts area of your WordPress dashboard.

    You would then get and display post images from Gravity Forms creates posts no differently than non-Gravity Forms created posts. To your theme they are just posts. So you have to pull in images for that post from the Media Library using PHP.

    Here is an example on how to do this:

    http://www.rlmseo.com/blog/get-images-attached-to-post/

    Posted 14 years ago on Monday May 16, 2011 | Permalink
  3. Tmeister
    Member

    Hello.

    Incorrectly assumed that there was a function on gravity to do this, something similar to the variables {Image: 15}.

    Anyway your answer was very helpful and I head to the answer.

    Thanks.

    Posted 14 years ago on Monday May 16, 2011 | Permalink