Support » Plugin: User Submitted Posts » Automatically display images in post

  • Resolved mathiasppc


    Thanks for a great plugin!

    I’m having a hard time displaying the images in the posts. I know that I need to do something with custom fields, but not sure how. Could you please explain how this is done? I just want the images as ‘medium’ one after another in the post content.



Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m looking for this same ability, there’s some custom functions in the readme, but I really don’t want to lock into this one plugin, and would like to have either the ability to stick gallery short code into the post or (better!) have the plugin automatically insert the images into the posts with a size I specify on the settings page.

    Plugin Author Jeff Starr


    Hi Mathias, basically there are several USP template tags for displaying submitted images, which are attached as custom fields to posts. One example, you could add this tag to the WP Loop:


    Then there are parameters that can be specified to indicate size, set the number of images, and prepend/append text/markup before and after the image URL(s):

    usp_post_attachments('thumbnail', '<img src="', '" />', false);

    That will display all images attached to the current post, displayed as an image. More info on this tag (and others) in /library/template-tags.php.

    @tgiokdi: good news! submitted images are also inserted into the WP Media Library, so no need to use USP tags at all — you can use any WP tags needed to display the content.

    Also should mention the Pro version of the plugin that does all of this and much more either automatically or with shortcodes and plugin settings:

    Right, but it would be more code to add to any template changes, would be best if the image was inserted into the post or if the plugin permitted to have text pre-pended or appended to the post so we could throw in our own gallery shortcodes

    Plugin Author Jeff Starr


    That’s a great idea that I’ll try to implement in a future update. Thanks for the feedback

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Automatically display images in post’ is closed to new replies.