Show content of current user's role

By: maa maa | Asked: 10/13/2022
ForumsCategory: How-toShow content of current user's role
maa maa asked 2 years ago
Is there a way to show content based on user role? Thank you community! Maarlok  
3 Answers
Bobby Clapp answered 2 years ago

Not by default without custom code. An alternative solution is to use a plugin. I tend to use https://wordpress.org/plugins/members/ and then wrap my content in the shortcode for the user role (https://members-plugin.com/docs/shortcodes/).

Jane OnoratiJane Onorati answered 2 years ago
I use Members too and really like it and it's free!  You can create your own custom roles and then assign which roles can see your page or post in the WP editor.  It does not work with my event calendar plug-in though or not very well at least.  You have to make the event private to be able to restrict access which is rather limiting.
maa maa answered 2 years ago

i found this on the official guide but i can't get it to work for custom roles!https://formidableforms.com/knowledgebase/php-examples/#kb-show-content-based-on-current-users-role

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right