Post

1 follower Follow
0
Avatar

Can I show images in WordPress based on the user permissions?

Frank Hagan

Is there a way to set conditions in Wordpress to show certain images on pages based on user permissions for that page?

Answered

Official comment

Avatar

You can use shortcodes to show or hide content based on membership level, tags, or if the contact is identified. The shortcodes for membership are:

[show_if has_one="Many,levels"] content [/show_if]

Displays content only for members who are logged in and have ANY of the membership levels listed (separated by commas).

 

[show_if has_all="Many,levels"] content [/show_if] 

Displays content only for members who are logged in and have ALL of the membership levels listed.

 

[show_if not_one="Many,levels"] content [/show_if] 

Displays content for members who are logged in and are missing ALL the memberships listed.

 

[show_if not_any="Many,levels"] content [/show_if] 

Displays content for members who are logged in and are missing any of the memberships listed.

For tags, it is:

[show_if has_tag="Tag"] content [/show_if] 

This displays content only for members who are logged in and have the tag indicated by "Tag"

 

And last, use the following to show/hide based on if a contact is identified:

[show_if is_contact] content [/show_if] 

Displays content if visitor is an identified contact in your database

 

[show_if not_contact] content [/show_if] 


Displays content if visitor is not an identified contact in your database

Frank Hagan

Please sign in to leave a comment.

1 comment