USP Pro makes it easy to display submitted content anywhere in your theme. Once a submitted Post, Page, or Custom Post Type is submitted and approved, it may be displayed using the shortcodes and template tags provided by USP Pro, as well as those provided by WordPress. Likewise, uploaded images, video, audio, and other supported file types may be displayed with granular control over the number, type, size, and other attributes of each file. Uploaded images may be used as featured images, displayed in post content, and/or displayed in post content automatically.
Browse support forums for USP Pro »
Forum : Displaying Content
There are 54 posts in this forum.
Regarding displayed images in the default Image Preview Demo:
When displaying a post submitted with images, the images are displayed at my theme’s thumbnail size: 140×140
How can I change this from the thumbnail size to say “medium” or “large” size, defined in the “Settings >> Media Settings” control panel? (here:
http://example.com/wp-admin/options-media
)Step 1) Disable the Uploads Setting to “Auto-display images”
Step 2) Add this code to your theme template in the loop (e.g., single.php):
Much more is possible with this and other template tags; check out: USP Pro Shortcodes, and also: USP Pro Template Tags.
Great, thanks! I’ll try to do it all with shortcodes first :)
I’ve enabled custom post types for submitted content, but when I try to preview a submitted post from the front-end, I get a 404 Not Found error. The submitted post appears in the Admin Area, but not on the front-end in the theme.
Great question. How your theme displays custom post types depends on its included template files. In general, to display custom post types, a theme must include two files:
archive-custom-post-type.php
andsingle-custom-post-type.php
, where “custom-post-type” refers to the name of the custom post type.For example, to display the USP custom post type, the two required theme template files would be
archive-usp_post.php
andsingle-usp_post.php
. USP Pro includes basic templates for each of these files that you can add to your theme. They are located in the/templates/
folder, and will give WP something to use to display the custom post types.If the template files are included and the custom post types still aren’t displayed, then there is another thing to try. As explained in the Tools > Tips & Tricks, try simply visiting the WP Settings > Permalinks screen.. doing so is reported to fix a well-known WP bug with custom post types and getting them to be recognized.
How do I display custom fields on all posts?
Add this to your theme template file (anywhere inside the Loop):
Then where it says “name-of-custom-field..” replace it with the name of the custom fields used by the images you would like to display. These are viewable from within the Edit Post screen, beneath the post content area. If you don’t see any panel that says “Custom Fields”, visit the Screen Options from the top-right corner of the page, where you can enable/disable its display.
Then once you’ve seen how this basic example works, you can use any USP or WP template tags to display exactly what is required, anywhere in your theme. Here is a handy table of USP Pro template tags:
https://plugin-planet.com/usp-pro-template-tags/
Hi, when displaying a post submitted with images, the images are stuck (pegadas, muy unidas) you can see it. How can separate it with margin?? Thanks
Try adding some CSS to your theme’s style.css file:
:)
Excelente hermano!! Resolvió mi problema! Saludos desde Ecuador! Muchas gracias!!! =)
No problemo señor :)
How would I get a form to display in a Genesis child theme?
Hi Bill, it should be the same as adding a form to any WP theme, just add the template tag as explained here:
https://plugin-planet.com/usp-pro-template-tags/
Specifically look at the very first tag,
<?php display_usp_form($id, $class); ?>
, where$id
is the form ID and$class
is optional. Also have a look at:https://plugin-planet.com/usp-pro-template-tags-best-practice/
And even more info here:
https://plugin-planet.com/usp-pro-displaying-usp-forms/
Is it possible to combine inputs? For example, I want the eventual post title to be “Post Title + Custom Field”. Where would I edit the code to make this happen?
Hi Regnard,
I know that this question was answered offline, but I wanted to post here online for the sake of others.
Something like that (combined inputs) is not done automatically, but you can do it by including two custom fields in your form: one for the first part of the title and another for the second part. Then you can use a template tag like
get_post_meta()
to display the fields together, for example:That would go in the Loop in your
single.php
file (or whichever theme file that is relevant for your goals. You can get the names of the custom fields on the Edit Post screen beneath the post content in the Custom Fields panel for any submitted post. Note that you’ll probably want to customize the output to display as intended (markup, etc.)I love USP and I have a question. Is it possible to assign a fixed featured image to every post that is submitted? We don’t want to let the user choose an image. There must be one and the same image set as featured every time the user submits a post. Thanks for your help!
This is something that you can do without using any plugin. Just do something like this in the Loop:
That’s just an example to get you started, you’ll want to customize to suit your needs. More info on the Loop:
https://codex.wordpress.org/The_Loop
Hi I used in my post content break line but it does not appear when I publish posts.
//what I write in the text area
apple
orange
House
nice
// but what I got was
apple orange House nice
Break line did not translated :( what should I do?
Hi Hamid, you can enable Post Formatting.
Hi Jeff,
I have a “Member’s only” sub-page installed and want my USP Form only to be displayed for logged in users on this page. But it seems to me, that any visitor can visit the form through the permalink
http://mysite.de/usp_form/nameofmyform
. Am I wrong? And if not, how can I disable visitors to see the form through the permalink?Thanks in advance!
Just to follow up with this, I’ve posted a tutorial that explains how to “hide” the default/direct form URLs.
Cheers!
I have the USP Forms Pro installed as well as the Custom Post Type UI plugin, but how do I get a USP Form to post to a new custom post type instead of the standard WordPress “all posts” page?
You can add a hidden field to the form, for example:
..would add a CPT of “book”. Here is complete infos on adding Custom Post Types with USP Pro.
So I did that… but it’s not posting the fields… only the content box. Do I need to edit the CPT template to post the field submissions as well?
This is the USP form page:
http://www.mainedogmagazine.com/build-dogs-profile/
This is the CPT once submitted:
http://www.mainedogmagazine.com/dog_profile/tito/
Basically, yes. By default, most theme templates don’t display any custom fields (things like “dog name”, “breed”, “age”, and so forth). So as you suggest, you can either edit the CPT template to display the fields (using template tags), or you can use the free Helper Plugin to automatically display whichever custom fields you specify.
Hi Jeff, thank you for USP Pro. My question: is it possible to have a form with several “text boxes” where unformatted text is entered and then is displayed in specific areas on the page when posted / published? Thank you!
Glad to help. Yes, what you describe is possible with USP Pro. Here are the basic steps:
1) First make sure to read and follow the Quick Start Guide, before messing with any settings.
2) Once you are familiar with how the demo forms work, create a new form. Here is another good tutorial for creating forms.
3) Add some fields to the form using the USP Quicktags (available when using the Text editor on any “Edit USP Form” screen. For example, you might do something like this:
4) Then add a few of custom fields for your three “text boxes”. Here is a video tutorial that shows how to add Custom Fields.
5) That’s it for the form, don’t forget to Publish the form and save changes.
6) Submit a test post using the form you just created.
7) Visit the test post in the Admin Area. You can view the custom fields in the “Custom Fields” meta box on the “Edit Post” screen. Tip: if you don’t see the “Custom Fields” box, you can enable it via the “Screen Options” (upper-right corner of the screen).
8) Lastly, to display the custom fields, install the free Helper plugin, as explained in this tutorial. Also check out our tutorial on displaying Custom Fields for more information.
That’s it in a nutshell. It takes some time to set up your first form and see how it works, but then other forms should go much quicker once you get the hang of it.
This is a follow-up to an earlier question about links in posts (I’ve started a new topic because I can’t find the original question in the forum). Thank you for your reply, which has solved part of the problem. I’ve enabled post formatting and added the
<a>
tag, so that links inserted in posts are now preserved.But if, when inserting a link in a post, I check the “Open in new tab” option, the
"target="_blank"
seems to be stripped out when the post is submitted. Is there any particular tag I need to add to the Enable Post Formatting box to make this work properly.Glad to help. The
target
attribute is disabled by default for security reasons. See this article for infos.But if you are sure that you want to allow target attributes on submitted links, you can enable them by adding this snippet to your theme’s
functions.php
file:No other changes need to be made, just save changes and done.
Hey Jeff! I want to display links to my uploaded files, how can I do it?
You can use the free Helper extension and combine fields, for example if you wanted to display links for two different file uploads, you could do something like this:
That would be for the first file link. And then you would add another two rows in the Helper plugin for the next link, for example:
Of course, you can modify the markup however is needed. The key is to split each link into two rows in the Helper plugin. That way you can use the file name/URL twice: once for the href value and another for the link text.
Thanks Jeff. What if I want to use an image for the link instead of the file URL?
If you are using the Helper extension, you can add the URL of the image in the third helper field. For example if you have this:
And you have an image located at, say:
https://wherever.com/image.jpg
Then you can do this:
Remember to replace the “usp-custom-1” with the actual name of your custom field.
I can’t get [usp_pro_display_posts userid=”all”] to work. Iv’e added “add_filter(..)” to functions.php. I’m using UST Posts as post type. If I change post type to regular WP Posts then usp_pro_display_posts works but only for this post type. Iv’e copied the archive-usb_post.php to my templates. Also worth noting is that I’m using blade for my templates.
I found the sollution in the documentation. [usp_pro_display_posts post_type=”usp_pose”] solved it. Duh.
Content Display WYSIWYG format is not displaying when I’ve copied and pasted submitted a post. The text is jumbled and often times the links within the content are not active.
By default HTML tags (like those used for formatting text and links) are not allowed in submitted post content. To enable/allow tags, follow this guide on how to enable Post Formatting.
Is there a template equivalent for these shortcodes?
I want to wrap them around my post template so that other people won’t be able to view a user’s post if they have the link.
Thanks!
No but you can use the WordPress function
do_shortcode()
works just the same. More info at the WP Codex.Hello! Looking for an easy way (via shortcode, if possible) to display a) a total count of a USP Pro custom post type, and b) a total count of instances of a particular value of a custom field type.
In other words, I’d like to be able to display (wherever I’d like) something like ‘we currently have x posts of this custom type, and y that have this value for this field’.
Is there a straightforward way to do this?
Thanks!
Lex
Hi Lex, USP Pro focuses on forms. But there are plugins out there that can display statistics about your site. For example, my own plugin Simple Blog Stats should cover most if not all of the bases.
Thanks! I’ll give that a try.
Hi there – great plugin! I hope I’m in the right forum for this – How can I go about replacing the default URL of my USP Posts. Currently the resulting URL format is
domain.com/usp_post/postname/
(I’m using Post Name permalinks)I’d like this to be
domain.com/whatever_i_like/postname/
As a bonus, it’d be great to ‘USP Posts’ to a custom string on the back end, too (I’ve tried foing this with backend translators, to no avail), but it’s really the URL issue that’s important to me.
Thanks!
Hi Lex, to change the
usp_post
slug, visit the plugin setting “Slug for USP Post” under the Advanced tab.Ah, that’s great. I hadn’t noticed that feature. Thanks!
Hello there.
I’ve just got the USP PRO after trying out the free plugin that worked like a charm.
In this new USP PRO I have created a form and want to post it on a page using the shortcode for the form:
[usp_form id="kandidatur"]
However, the form only displays the submit button. I realize that the form has to be published, which I have checket that it is. (several times).. Still the form fields are not shown using the shortcode, only the submit button.Is there any settings I have missed or other?
The free plugin worked fine displaying the whole form.
Best regards.
Lars
Hi Lars, glad to help. The only time that can happen is when the form is not published OR when the form slug does not match the actual form. Given the shortcode you mention, the form that you want to display should have a permalink slug of exactly “kandidatur”. Anything else for the slug and it will not work correctly; it has to match exactly.
Hi Jeff,
Thanks problem solved. The permanent link name and USP_form id was not the same. It is now, and the form is shown. Thanks!
However, I’m struggling with getting the form data displayed on the post. I only get title, main content and image shown. Is it shortcodes for the rest of the data? I would like to have shown all data from the submitted form, 1:1 (if possible without coding php.)
Hope you can help me out.
Best.
Lars
In general, the theme determines which content is displayed (and where/how/etc.) on the front end. So for primary fields like Name, Title, Content, Tags, and so forth, that all depends on your theme template. For custom fields, like Phone, Movie, Car, or whatever, you can use the free Helper addon, which makes it super easy to display custom fields before or after submitted post content. Here is a link to the Helper plugin documentation.
Thanks Jeff.
I´m using the NewsPaper theme. Not sure if that supports shortcodes better than others but I assume it is. Regarding the Helper Plugin. Do you have more screenshots or examples on custom fields? I tried different things but the fields from the form are not showing in the post. only title and content. Thanks in advance!
Best.
Lars
Hi Jeff.
Just saw your very nice tutorial video: https://plugin-planet.com/usp-pro-displaying-custom-fields/ It cleares things out very well. It works perfectly!
Thanks.
Awesome glad you got it sorted. Cheers, Lars.
Hello, thanks for USP PRO, it does exactly what I need. I have a problem, the content of personalized fields is well displayed in the articles on front end, but in the back end, only appears the title and content fields, so I can’t change the content of the custom fields after publication. I guess I have to change a template somewhere ? Thank you for your help !
Hi Nathalie,
To display the Custom Fields meta box, follow these steps:
Done!
Editor’s note: this thread happened via email, posting here in the forum in case it is useful for any other users.