PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Hiding Comments

s2Member Plugin. A Membership plugin for WordPress®.

Hiding Comments

Postby BobTabor » April 28th, 2011, 4:34 pm

Hi, is there a way (using s2Member Pro) to hide comments in a WordPress Post or Page based on their membership level? Ex. only paying "Platinum" members can view / create comments?
User avatar
BobTabor
Experienced User
Experienced User
 
Posts: 84
Joined: April 28, 2011

Re: Hiding Comments

Postby Cristián Lávaque » April 28th, 2011, 5:11 pm

Hi Bob. :)

This is not something s2Member controls by default, but you could customize it using s2Member's advanced conditionals in the theme files. WP Admin -> s2Member -> API / Scripting -> Advanced Conditionals and Advanced Query Conditionals

Let me know if that helps.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Hiding Comments

Postby artEV » April 28th, 2011, 9:57 pm

Yep, I incorporated this too.
Depending on your theme, upgrade message and membership options page link, code could look something like this on the single.php and page.php theme files:

Code: Select all
<?php if (current_user_can("access_s2member_level1"))
{  comments_template('', true); } else { ?>
<div class='promsg'><h2>Pro members get to participate in post discussions!</h2><br />
<p><b>This post currently has <?php comments_number('no responses','one response','% responses'); ?>.</b><br />Upgrade to Pro now to enjoy interaction with fellow members.<br />
<a href="http://mysite.com/membership_options_page">> Get Pro Membership</a></p></div>
<?php } ?>
User avatar
artEV
Experienced User
Experienced User
 
Posts: 32
Joined: April 26, 2011

Re: Hiding Comments

Postby BobTabor » April 28th, 2011, 10:07 pm

Outstanding! Thank you, both.
User avatar
BobTabor
Experienced User
Experienced User
 
Posts: 84
Joined: April 28, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron