WordPress.org

Forums

  1. liquidenvy
    Member
    Posted 1 year 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?

    http://wordpress.org/plugins/s2member/

  2. cassel
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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