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.

Uploaded picture as content

  1. This question is related to my previous question:
    http://www.gravityhelp.com/forums/topic/image-in-post#post-54200

    I got the image to the content of the wordpress post, very happy with that. But i have 2 questions about it.

    1. The form wraps <p> tags around the image. This gives errors when i validate the html of the website. This might be something i need to fix on the website itself but i hope i can do i through the form itself. On the website I only call for '<?php the_content(); ?>' without <p> tags around it.

    2. Is it possible to give the image a title and/or alt text that is not filled in on the form? I would like to give all the images the same title and alt text that is filled in automatically.

    Thanks in advance.

    Posted 12 years ago on Friday April 6, 2012 | Permalink
  2. Do you have a link to your form and a post that's been created from it?

    Posted 12 years ago on Friday April 6, 2012 | Permalink
  3. Yes, the form can be found here:
    http://picturepalace.eu/upload

    Every post you see on the website has been created with the form.

    Posted 12 years ago on Saturday April 7, 2012 | Permalink
  4. The problem with the <p> tags could be resolved from wordpress itself, there is a function for it:
    '<?php remove_filter ('the_content', 'wpautop'); ?>'

    Now i am only wondering if i can give the images uploaded through the form a title and/or alt text that is not defined by the uploader himself.

    Posted 12 years ago on Sunday April 8, 2012 | Permalink
  5. I tried it like this:

    <img src="{Your awesome picture:4:large}" alt="My alt text" title="{Title of the post:1}" />

    The image is not shown when i use it like this. Am i just doing something stupid? :p

    Posted 12 years ago on Tuesday April 10, 2012 | Permalink
  6. Do you have a link to that post where you tried that image? Was it even in the source code at all?

    Posted 12 years ago on Tuesday April 10, 2012 | Permalink
  7. Yeah you can see it here:
    http://picturepalace.eu/nice-body/2012/04/10

    This is the source code it creates:
    <p><img src="<img width="450" height="405" src="http://picturepalace.eu/wp-content/uploads/2012/04/12-450x405.png" class="size-large alignnone wp-image-372" alt="12" title="12" />” alt=”My alt text” title=”nice body” /></p>

    Posted 12 years ago on Tuesday April 10, 2012 | Permalink
  8. Did you try something to the effect of: {Your awesome picture:4:large:url}

    Posted 12 years ago on Tuesday April 10, 2012 | Permalink
  9. Very nice, the :url part did the trick.

    I have to say that the support on this plugin is great :)

    Thanks

    Posted 12 years ago on Wednesday April 11, 2012 | Permalink
  10. Right on! Glad to help, and thanks for the kind words. :)

    Posted 12 years ago on Wednesday April 11, 2012 | Permalink

This topic has been resolved and has been closed to new replies.