• Resolved robphat

    (@robphat)


    Using this great plugin on another site, but I’m trying to see if I can do something specific.

    I need to show a piece of content to users who are not a member of one group, but hide that same content from users who are members of another group. Can this be done with the Membership plugin?

    Thanks,
    Rob

    https://ww.wp.xz.cn/plugins/groups/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author itthinx

    (@itthinx)

    Hi Rob,

    To show content to users who are not a member of one particular group, you can use this:

    [groups_non_member group="Foobar"]
    Here is the content that you want to show to people who are not a member of the Foobar group.
    [/groups_non_member]

    Shortcode reference: http://docs.itthinx.com/document/groups/shortcodes/groups_non_member/

    To show content to someone who belongd to a certain group:

    [groups_member group="Smurfs"]
    You're in the Smurfs group.
    [/groups_member]

    Shortcode reference: http://docs.itthinx.com/document/groups/shortcodes/groups_member/

    And you can combine these two, this should be a solution to your question:

    [groups_non_member group="Blue"]
    
    You are not a member of the Blue group.
    
    [groups_member group="Red"]
    
    ... and you are a member of the Red group.
    
    [/groups_member]
    
    [/groups_non_member]

    By the way, if you haven’t rated the plugin already it would be great if you could do so, the reviews seem to help to spread the word 🙂

    Cheers

    Thread Starter robphat

    (@robphat)

    Kento, I believe I have rated the plugin before as I have used it before, but I will rate again.

    Regarding my request, are you saying we can nest the shortcodes? I don’t think I communicated properly what I am trying to do, because what I used from your last reply didn’t work.

    Specifically, I need to show content only to users who are not members of 2 specific groups simultaneously…not that they are not members of one group or another, but that they are not members of either group.

    So, I need to show content X to people who are not members of Group 1 and who are also not members of Group 2.

    If they are not members of Group 1, but they are members of Group 2, then content X will not show.

    Alternatively, I could just hide the content from people who are members of either group. That may be easier. Is there a shortcode to hide content from users in certain groups, but to show it to everyone else?

    I hope I am being more clear this time. How can I accomplish this?

    Thanks,
    Rob

    Plugin Author itthinx

    (@itthinx)

    Hi Rob,

    You can nest two different shortcodes, but nesting two instances of the same shortcode with different parameters will fail.

    Alternatively, I could just hide the content from people who are members of either group. That may be easier. Is there a shortcode to hide content from users in certain groups, but to show it to everyone else?

    The following example is a solution if you can work with not showing the content to someone in either or both of two groups (you can also specify more than two groups) :

    Content shown to those who do not belong to Blue or who do not belong to Red:
    [groups_non_member group="Blue,Red"]
    Shown if not a member of Blue or not a member of Red.
    [/groups_non_member]

    Cheers

    Thread Starter robphat

    (@robphat)

    Kento,

    Sorry for delayed reply. But yes I had actually tried the shortcode you just sent after your last email about combining groups for groups_member.

    It worked just as you said for groups_non_member also.

    Thanks again for the great plugin!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Content hiding/showing’ is closed to new replies.