New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

BuddyPress Member Types Pro comes with the following four shortcodes for content visibility.

  • [bpmtp-show-if-member-type]
  • [bpmtp-show-if-not-member-type]
  • [bpmtp-hide-if-member-type]
  • [bpmtp-hide-if-not-member-type]

Showing content based on BuddyPress member types:-

You can show content based on BuddyPress member types using the shortcode [bpmtp-show-if-member-type] . It will make contents visible only to the specified member type(s).

Syntax:-

[bpmtp-show-if-member-type in="one,more,member-type"]Some content visible to these member types[/bpmtp-show-if-member-type]

Options:-

  • in:- string, one or more member type whom the content will be visible.

Example:- Showing content to only student members.

[bpmtp-show-if-member-type in="student"] Hello Student, Welcome to Omega High. [/bpmtp-show-if-member-type]

Example:- Showing content to teachers and staffs only.

[bpmtp-show-if-member-type in="teacher,staff"]Hello there, welcome back to the new session. Some other content. [/bpmtp-show-if-member-type]

Showing content if user does not have the specified member types:-

You can use the shortcode [bpmtp-show-if-not-member-type] to show the content to the members who don’t have the specified member type.

Example:- Only showing to non student members

[bpmtp-show-if-not-member-type in="student"] This will be visible to all members except students [/bpmtp-show-if-not-member-type]

You can specify a comma separated list of more than one member types in the in clause.

Hiding content from specific member types:-

You can hide contents based on member types using the shortcode [bpmtp-hide-if-member-type]. It allows you to hide contents from specified member types.

Example:- Hiding from students.

[bpmtp-hide-if-member-type in="student"] It will be hidden from students. [/bpmtp-hide-if-member-type]

Yes, it is same as bpmtp-show-if-not-member-type.

Hiding content if user does not have specified member type:-

You can hide contents from users who don’t have one or more specified member types using the [bpmtp-hide-if-not-member-type] shortcode.

Example:- 

[bpmtp-hide-if-not-member-type in="student" Hidden from everyone except student. [/bpmtp-hide-if-not-member-type]

Yes, it is exactly same as [bpmtp-show-if-member-type] shortcode.