1. liquidenvy
    Posted 2 years ago #

    I'm no coder, so forgive me if this is an ignorant question... would it be possible to have a different featured image for a post, depending on the membership level of the user?


  2. cassel
    Posted 2 years ago #

    Yes, by using conditionals, it is very simple (even if the code can look scary). I am using something like this on my own site:

    [s2If current_user_is(s2member_level0)]<img alt="" src="your image for level0" /></a>[/s2If]
    [s2If current_user_is(s2member_level1)]<img alt="" src="your image for level1" /></a>[/s2If]
    [s2If current_user_is(s2member_level2)]<img alt="" src="your image for level2" /></a>[/s2If]
    [s2If current_user_is(s2member_level3)]<img alt="" src="your image for level3" /></a>[/s2If]
    and so on

    Since the user can only have ONE level, they will always fall into one of the categories you list (making sure you do list all the levels you are using).

    On my site, I use a black and white image of a course they do not have access to, but linked to the sales page, and a colored image if they have access to, linked to the course page (a nice way to advertise what you have to sell!)

  3. liquidenvy
    Posted 2 years ago #

    I've got a good handle on using conditionals for images WITHIN a post, but I'm referring to the featured image attachment, which is not referenced in the body of the post. My theme puts thumbnails of the featured image for each post on the front page, and I'm wondering if there is a way I can get a different thumbnail to show up depending on the user's level.

    I'm thinking this would need to be coded into the actual theme...?

  4. cassel
    Posted 2 years ago #

    Oh I see. Unfortunately, I don't know that one (I don't even know how to get the feature image to appear in the first place, I just have it in the post!)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic