Plugin Planet

Premium WordPress Plugins

USP Pro enables you to display forms anywhere in your site. You can use shortcodes to display forms in Posts and Pages, or use template tags to display forms anywhere in your theme template (e.g., single.php). You can also display USP Forms in any widgetized areas using the USP Form Widget. These options provide quite a bit of flexibility as to where and when your forms are displayed, and you can get even more granular control using WordPress conditional tags.

Conditional tags include tags such as is_single() and is_home(). There are many conditional tags listed in the Codex. For example, you can use is_home() to display the form (or any content) only when the visitor is viewing the home page:

<?php if (is_home()) {
	display_usp_form(123, false);
} ?>

This will check to see if the current page is the home page, and if so use display_usp_form() to display the specified USP Form (“123” in this example).

Display form to logged in users

Now let’s use conditional tags to display the form only if the current visitor is logged in to WordPress.

<?php if (is_user_logged_in()) {
	display_usp_form(123, false);
} else {
	// not logged in
} ?>

To do the same in any Post or Page, we can use USP shortcodes:

[usp_form id="123"]

Just change “123” to the id of your USP Form and done.

Pro Tip: any [usp_form] that you want to display via shortcode must be published (not draft or pending).


Here is an example showing how to display any USP Pro form to logged-in/registered users, and then display alternate content to non-logged-in users/visitors.

Step 1: Once you have a form built, you can display it to logged-in users by including the following shortcodes on any Post or Page:

[usp_form id="submit-article"]

Change the id to match your form.

Step 2: Then to add content that only visitors will see, include the following shortcodes on the same Post or Page:


Here we are using the [usp_login_form] shortcode to display a login/register form to visitors. Of course, this is just an example — you can display anything that is required to logged and/or not-logged guests.


For reference, here are the other shortcodes for displaying conditional content:

  • [usp_access cap="read"][/usp_access] – Display content based on user role
  • [usp_visitor][/usp_visitor] – Display content only to visitors (not logged in)
  • [usp_member][/usp_member] – Display content only to logged in users

More information