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.

Subscription Post Indicator

Home Forums Community Forum Subscription Post Indicator

This topic contains 7 replies, has 4 voices. Last updated by  Christopher Lyke 3 years, 9 months ago.

Topic Author Topic
Posted: Sunday Mar 10th, 2013 at 3:08 am #44193

Is there a way that I can have a small indicator that is displayed on the main headlines whether a post or page is a subscriber only content and a free content post/page? This is partly an issue as I want to post a decent mixed number of free content and premium content. I have seen places like the football recruiting sites have that feature available to them. It would be nice if this was included with the s2member plug-in .. right now there is no way you can tell whether a post/page is free or subscription unless you click on the post/page and view it physically.

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Monday Mar 11th, 2013 at 2:50 pm #44273

just looking for a way to have this done.

Posted: Monday Mar 11th, 2013 at 10:30 pm #44298
Eduan
Username: Eduan
Moderator

Hello Christopher,

Basically you want to have some sort of visual indicator if a page is protected or not, correct?

I can certainly add this as a feature request if you confirm this is what you want. :)

– Eduan

Posted: Monday Mar 11th, 2013 at 10:42 pm #44300

That is correct :)

Posted: Wednesday Mar 13th, 2013 at 1:34 pm #44507

You could probably customize the post’s template to check if it has any restrictions and show some indication when the admin (i.e. you) is the one viewing it.

Posted: Wednesday Mar 13th, 2013 at 6:25 pm #44546

There is no possible setting.

Posted: Friday Mar 15th, 2013 at 8:05 pm #44863
Bruce
Username: Bruce
Staff Member

There is no possible setting.

This is to be expected. If you’d like to add functionality to see if a Post is protected, you’ll need to have custom code either in your theme’s template, or in a Must-Use Plugin.

s2Member provides you with a PHP function that should help you (or your developer) to set this up. You should be able to grab the current post’s ID, and check to see if it is protected by s2Member using the is_post_protected_by_s2member function.

An example of how this might look:

<?php
global $post;
if(is_post_protected_by_s2member(($post->ID)) {
	// Display something showing that the post is protected
}
That’s about as far as we can go with custom code. If you need further assistance, we recommend http://jobs.wordpress.net, or another freelance web site where WordPress® experts are offering their expertise through a bid on your project.
The global $post variable used in the above code sample does not work until WordPress has decided what Post it is displaying. This means that hooks such as init, and plugins_loaded will not work with this global variable.

See Codex here: http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_is_post_protected_by_s2member()

Posted: Saturday Mar 16th, 2013 at 1:48 am #44898

enough to make my head spin

Viewing 7 replies - 1 through 7 (of 7 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.