Video Tutorial: How to Display a Members-Only Graphic on a Wishlist Member WordPress Website

Using a “member-only” graphic to brand your posts is a great way to give non-members a “sneek-peek” at the content that is available to them if they become a members. 

In the following video, WishList Insider Contributer Betty Walker (the Wise Web Lady) shows you how you can add this feature to your membership website by using the WishList Member API.

As a note, here is the line of code that was added to the archive.php which calls the API function to accomplish this:

<?if(in_array(“Premium”,WLMAPI::GetPostLevels($post->ID)))
{echo “<img border=0 src=’/wp-content/themes/magazine_10/images/member-only.jpg’>”;}?>

Tags: , , ,

Read full story · Comments { 35 }

About WLM Team

The WishList Products Team is comprised of a diverse group of individuals who have come together to promote and teach about all things WishList related.

, , ,

Related Posts

35 Responses to Video Tutorial: How to Display a Members-Only Graphic on a Wishlist Member WordPress Website

  1. M June 15, 2010 at 11:19 am #

    Thanks Betty, and after this don’t forget to teach us how to display user gravatar..wink!wink!;)

  2. Rick Anderson June 15, 2010 at 1:03 pm #

    This is a very important subject. The main reason I joined Insider was to learn how to use the API and other customization functions.

    I have a more complex membership/content scenario AND I want most of my content to be discoverable and indexable by Google.

    So in my case simply hiding pages or posts doesn’t work.

    What I ended up doing was placing my protected content within custom fields, using the API to determine the membership level of the viewer and using custom functions to decide which level of content to display. In this way, every page displays content based on the user level.

    This then allowed me to indicate the availability of content to the user based on their logged in status. A green check (and message) if the content is available to the viewer, a yellow check if the content is available to free members (when the free member isn’t logged in) and a red symbol that shows for premium content when user isn’t logged in as a premium member.

    You can see this system at work here http://www.byobwebsite.com/video-tutorials/start-building-your-website-here/. This made it much more clear to my members and potential members what was available and what wasn’t.

  3. Betty Walker June 15, 2010 at 1:55 pm #

    By making the API available, Wishlist Member has opened the door for developers to increase the functionality in their membership websites and add these kinds of customized features. Thx for sharing, Rick!

  4. Stu McLaren June 15, 2010 at 5:47 pm #

    Great post Betty!

    @Rick – thanks for sharing your tips as well.

    We LOVE seeing how everyone is getting creative with WLM.

    As a group, you guys will always be WAY more creative than just our team at WLP so the more valuable this membership becomes for everyone :)

  5. David Brinton June 16, 2010 at 12:19 am #

    Thanks Betty. I ca nsee how this would be of benefit to the members and the owners.

    Rick’s explanation gave me more clarity of mind as to why this is important. Thank you all.

  6. Ken Geers June 16, 2010 at 10:21 am #

    Betty thanks for the info. We do not have a membership site yet but this is the kind of information that helps to prepare us for that day.
    Take care

  7. Steve Dimmick June 16, 2010 at 1:43 pm #

    Awesome Betty! Well done ;)

    Also great to see a fellow Insider as a bonafide contributor.

  8. Bob Patterson June 16, 2010 at 6:04 pm #

    Betty, dynamite tutorial. You’ve raised the bar for the rest of us…one of the best contributions by a member yet.

    • Betty Walker June 16, 2010 at 6:59 pm #

      Thx, Rick and Steve – good to hear kudos from fellow certified developers!

  9. Tony Baker June 17, 2010 at 2:23 pm #

    It would be great if this was a plugin. Plus, the option to change icon by member level. bronze, silver, gold, etc.

    • Betty Walker June 20, 2010 at 7:17 pm #

      Thx for the suggestion of making this a plugin for wishlist, Tony – I will take it under consideration :-)

  10. Jennifer June 17, 2010 at 4:37 pm #

    Thanks for the tutorial Betty. I have people who’ll appreciate this in the future (and I appreciate it now).

    Thanks!

  11. Joel Preston June 19, 2010 at 12:12 pm #

    Totally agree with Tony. It’s great the the API is available to developers and power users like Betty. But for those of us who just want to run a robust membership site without becoming css and php geeks, this feels like a feature that should just be a part of WLM, or offered as a future bonus plug-in (hint, hint).

    [Not to disparage WLM - awesome program. You guys rock!]

  12. Diane Stafford June 19, 2010 at 12:39 pm #

    Betty, really useful info. I’d appreciate more ‘geek corner’ posts like this, thanks for this.

  13. Deb Augur June 20, 2010 at 12:23 pm #

    Wow. This is fabulous information. I’m just now building my wishlist site and I had no idea this was even possible.

    Thanks so much for sharing your wisdom!

  14. Bob Patterson June 23, 2010 at 1:15 pm #

    Here’s another big THANK YOU to Betty!

    I was having a heck of a time using the code on a site I’m building with Headlines. the theme kept breaking every time I inserted the code and I couldn’t figure out why. Everything looked perfect.

    Finally I asked Betty for some guidance. She quickly spotted the fact that my code had the wrong style of double quotes as a result of copying and pasting from the post above.

    It would have taken me forever to find that one. But thanks to her experience I was off and running.

    Ww’re not sure if it was a quirk with my text editor (EditPlus) or operator error. If you’re having similar issues check to make sure your double quotes are straight up and down like this ” and not angled like this ”

    What a great resource we have here.

  15. Bob Patterson June 23, 2010 at 1:18 pm #

    Correction. I had to copy and paste my last post because I wasn’t logged in and I see it caused the second set of quotes to look like the first.

    Here’s the correct double quote style ”
    Here’s the incorrect ”

    Hopefully the formatting will remain the same after I submit. If not, sorry.

  16. Betty Walker June 23, 2010 at 1:59 pm #

    Thx, Bob for sharing that with everyone – trying to copy/paste code from a post like this can sometimes be a bit problematic, and PHP is picky about those kinds of things!

  17. Chris Bryant July 21, 2010 at 7:37 pm #

    In the code example above, is PREMIUM the name of a membership level?

  18. Betty Walker July 21, 2010 at 7:48 pm #

    Hi Chris,

    Yes, you are correct – Premium is the name of the example membership level, so you would substitute your membership level in the code where Premium shows.

  19. Chris Bryant July 21, 2010 at 9:33 pm #

    Thanks Betty. This is a very helpful tutorial! I appreciate the quick response too! take care.

  20. Adam Warner August 19, 2010 at 1:41 pm #

    Hi all,

    Great tip Betty! It would also be useful to wrap this in a function to be placed in your theme’s functions.php file.

  21. Kevin McGillivray September 7, 2010 at 3:24 am #

    Hi, Betty. Thanks for a great tutorial. I found that this may not work if your premium membership plan is set to have access to “All Pages”, “All Posts”, etc in the Membership Levels under the plugin settings.

    I created a new post and set the Protection Settings on the post to “No, do not protect this content”. When I published the post, the Premium Content graphic showed up.

    I think what happens was that because the Premium users have access to it, it’s calling it premium content even though regular users have access to it, too. I haven’t read the API docs yet so I could be speaking out of turn but I think (in my case, anyway) the code should also check to see (1) that the item is protected and (2) that other membership levels (such as a free level) do NOT have access to it.

    If you need any more info about what I ran into, please let me know. In the meantime, I’ll get a copy of the API docs so I understand this better. :-)

    Thanks!
    Kevin

  22. Tony Baker September 30, 2010 at 12:55 pm #

    I was just wondering if a plugin was ever made for this.

    • Wray September 30, 2010 at 2:33 pm #

      This is something we are working on so watch for this in the future :)

  23. Tony Baker September 30, 2010 at 10:43 pm #

    I tried this and I just don’t know what I’m doing. I can usually make minor changes, but I don’t really “know” code.

    I’m using a Woothemes called Headlines. Specifically headlines/archive.php … can anybody send me that with the code in the right place? Our member levels are “member, bronze, silver, gold, platinum.”

    Also, I thought I read somewhere on this site where our registered users can be “member” .. AND be bronze or silver, or gold, etc. at the same time. The idea being that they’ve joined and paid and are now members. However, after they take quizes we advance them to other levels. Thanks in advance!

  24. JR Durruthy October 22, 2010 at 2:00 am #

    Thanks Betty for the tip. I was wondering how that got there.

    Where do we get the API docs?

  25. Steve Dimmick January 15, 2011 at 3:07 pm #

    I’m happy to announce that my team is about to release the TPress Premium Content Badge plugin – it is only days away from release.

    Existing clients of TPress Instant Levels will get an early bird/discounted offer.

    Watch http://www.torpedopress.com/wordpressplugins for the big announcement!

  26. Thom Dickey April 29, 2011 at 7:19 am #

    Thank you Betty for the info. I too think that this sort of thing should become a plugin if it is possible :-) I am thrilled with the latest 2.6 release.

  27. Thom Dickey August 26, 2011 at 12:50 pm #

    Do I need to put this code for each & every members only post or does this take care of all of them?

  28. Mandy March 16, 2012 at 10:22 am #

    Thanks Betty

    Has anyone been able to get this working on Optimize Press? I’m not able too.

    Kind regards
    Mandy

Leave a Reply

Videos powered by FLV Player Plugin