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.

Converting CMS to Show Teaser Content Easily

Home Forums Community Forum Converting CMS to Show Teaser Content Easily

Tagged: ,

This topic contains 2 replies, has 3 voices. Last updated by  raju maharjan 4 years, 1 month ago.

Topic Author Topic
Posted: Sunday Nov 18th, 2012 at 7:48 pm #31956

We are looking at doing at what I think is a relatively simple membership site. We already have a WordPress site with a few thousand posts. What we would like to do is to have the posts show teaser content that would require a user to register for free to see the whole post. This teaser content would just be the first X characters or words of the existing post. If the user wanted to see the whole thing, they would have to register which would be for free. The existing posts do not currently use a “more” tag. They just are full posts. Is there a way to just have s2 member automatically display a portion of the existing posts (and future posts) and then have a link at the bottom that says “To read the full post, please register for free”? Then when the user registers, they get redirected back to the full post and are a registered member. Is this possible with s2 Member?

As a second question, we may want to offer a second category of premium content down the road that users would register (upgrade?) to get access to. Is there a mechanism where the users currently registered could then upgrade for free which would give them access to the free and the premium content categories?

Thank you in advance for your assistance.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Tuesday Nov 20th, 2012 at 2:41 pm #32124
Raam Dev
Username: Raam
Staff Member

Hi Goose,

Please see my replies below:

Is there a way to just have s2 member automatically display a portion of the existing posts (and future posts) and then have a link at the bottom that says “To read the full post, please register for free”? Then when the user registers, they get redirected back to the full post and are a registered member. Is this possible with s2 Member?

Yes, this is absolutely possible. Normally I would recommend using the s2Member Shortcode Conditionals (Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals), however if you have several thousand posts, it would be a lot easier to edit your theme’s single.php file and add the necessary PHP conditionals (Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals) to check if the user is logged in. You can use the WordPress the_excerpt() function (docs here) to show the excerpt along with a register link to anyone who isn’t logged in.

As a second question, we may want to offer a second category of premium content down the road that users would register (upgrade?) to get access to. Is there a mechanism where the users currently registered could then upgrade for free which would give them access to the free and the premium content categories?

Yes, you can restrict categories of content in Dashboard -› s2Member® -› Restriction Options -› Category Access Restrictions. Then, you show existing members an upgrade button (Dashboard -› s2Member® -› PayPal® Buttons -› Subscr. Modification Buttons) to allow that user to upgrade their account to a Level that gives access to the category of content.

Posted: Tuesday Dec 4th, 2012 at 2:40 pm #33462

Use the following code in single.php.

The code below is to make sure all the posts in the the category “magazine” and its sub categories are protected and they can be accessed only with the custom capability -> magazine.


 <?php if (in_category ("magazine")||post_is_in_descendant_category( get_term_by('slug','magazine','category')) && !current_user_can ("access_s2member_ccap_magazine"))
				 {
				
				$membership_page =  get_bloginfo('url')."/membership";
				
				echo "<script>window.location.href='".$membership_page."'</script>";
				
				 }
				
				//the_content('');
				
				else{
					the_content('');
				}
				?>
Viewing 2 replies - 1 through 2 (of 2 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.