latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Restricting Comments to Paid Subscribers Only

Home Forums Community Forum Restricting Comments to Paid Subscribers Only

This topic contains 3 replies, has 4 voices. Last updated by  Raam Dev 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Nov 1st, 2012 at 12:16 pm #30326

I would pages and posts to be read only for all but would like to restrict posting of comments to paid subscribers. Please can you point me the right direction with a ‘How to’ or other documentation on how I can achieve this.
I am using S2 Member Pro.

Thanks

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Friday Nov 2nd, 2012 at 4:00 am #30400

Hi Lopa.

In that case, you’d leave the posts unrestricted, so they can be opened and read, but would need to protect the comments block with a conditional in your template. Video » s2Member (Advanced Conditionals)

I hope that helps. :)

Posted: Thursday Nov 8th, 2012 at 9:51 am #31033

Restricting Comments to Paid Subscribers Only – sorry to be a pain but I have looked through the videos without getting a clear idea of just what coding I need to restricting people from posting comments to only paid subscribers.

The rest of the site is working fine with all restrictions working perfectly for the past 12 months but for some reason I cannot fathom out how to restrict comments

It is probably right in front of me and obvious to everybody else but I cannot sort this …. can anybody please point me in the right direction.

I assume it will be just adding some code to the template ?

ciao
keane
http://www.giornaledibarganews.com

Posted: Thursday Nov 8th, 2012 at 5:54 pm #31070
Raam Dev
Username: Raam
Staff Member

Hi Keane,

This modification will require familiarity with the WordPress templating system. A WordPress theme is split into many different parts and then “put together” dynamically when you load the site. The comments section of a post/page is usually loaded through the comments.php template file. Each WordPress theme is coded differently, so I cannot explain exactly what you need to edit. If you’re not comfortable with PHP or WordPress you may want to post a job on jobs.wordpress.net or ask your question on wordpress.stackexchange.com or the WordPress.org Support Forums.

What you’ll need to do is add a conditional around the block that loads the comments, checking if the user has access (you can use the s2Member Advanced PHP Conditionals for that: Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals) and then load the comments if they have access or show a message (or nothing) if they don’t have access.

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.