User Role

In this article: About the User Role condition | How to set up a User Role condition using If-So

What is the User Role Condition?

The User Role condition allows you to display dynamic content based on the various user roles on your site.

If-So automatically pulls the list of user roles from your WordPress site and adds them to the dropdown menu of the User Role condition.

How to set up a page URL condition

  1. On your WordPress dashboard, go to “If-So → Add New Trigger”.
  2. Click on “Select a condition” and select “User Role”.
  3. Select the role for which you want to create dynamic content.
  4. In the content field, set the content to be displayed if the condition is met.
  5. In the default content field, set content to be displayed if the condition is not met (optional, can be left blank).
  6. Press “Publish” and paste the shortcode anywhere you want on your site.

FAQs

  • Will this work with server and WordPress caching solutions?

    Yes.

    Whether you are using a caching plugin or server caching, you can navigate to the plugin settings and enable the "Page Caching Compatibility" option. With the option enabled, dynamic triggers will be rendered in a separate request that will take place after the loading of the cached version.

    Learn more about Page Caching Compatibility.

  • Can I redirect users to a different page based on conditions?
    Yes. You can redirect users based on each one of the conditions by pasting a simple JavaScript code in the dynamic version content field. Click here for a step by step guide.
  • Was this Helpful ?
  • YesNo
Ready to get started?
Try it on your website