Restrict access to Content by User Role
If you use this shortcode the content will only be visible to the Editor. You can replace the editor with any other user role
You can also add the capability view_restricted_content to any user role and then the user with the specific user role can view restricted content. It works with the following shortcode
And you can use this for showing content on the page for users that are NOT logged in.
And you can restrict content to a specific user role by using the following shortcode. The user role can be replaced with any user role in your site.
If you login as an Editor you can see even more content on this page.
Try login using the following information:
Username: Editor
Password: TryMeNow
Content shown to users that are not logged in:
You can see this content if you are not logged in.
Content shown if you are not editor:
If you are not an editor you can see this text.
Content shown if you are not administrator:
If you are not an administrator you can see this text.