User Submitted Posts
[resolved] Automatically display images in post (5 posts)

  1. mathiasppc
    Posted 2 years ago #

    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.




  2. tgiokdi
    Posted 2 years ago #

    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.

  3. Jeff Starr
    Plugin Author

    Posted 2 years ago #

    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: http://plugin-planet.com/

  4. tgiokdi
    Posted 1 year ago #

    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

  5. Jeff Starr
    Plugin Author

    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Submitted Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic