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.

Show Teaser/excerpt using more tag single.php

Home Forums Community Forum Show Teaser/excerpt using more tag single.php

This topic contains 1 reply, has 1 voice. Last updated by  Steve Summer 3 years, 10 months ago.

Topic Author Topic
Posted: Friday Feb 22nd, 2013 at 11:37 am #42842

Hi,

i’m about to buy the pro version, but i’m still confused if s2member is the right plugin for my scenario.

I would like to show a teaser with HTML markup (not the_excerpt which has no HTML) on each restricted Post in single.php. The teaser should be followed by a “read more” link which redirects to the member option Buy page. Logged in users should see the complete content.

So basically i thought of a php condition (on single.php?) which checks if a user is logged in (or has the right access level) and decide which content is displayed:

On single post pages:
1. content till !–more– tag and “read more ….” link to subscribe page for public visitors
2. the_content() for logged in subscribers
3. unrestricted posts with !–more– tag should be shown to both public and registered users

This seems to me standard scenario, but i get the feeling nobody was brave enough to say that this is not working (even with hacking s2member).

After reading hundreds of support pages and posts in the last couple of days i get the feeling that MANY people have the same issue. There are a lot of hacks, but none seems to use native s2member-function. Some are way to complicated for editors without technical skills.

Editors should NOT be forced to paste conditions. They should only set the !–more– tag and mark the post as restricted somehow (if the post is restricted). unrestricted posts (with !–more– tag) should be possible as well!

This approach looks good, but is to complicated for editors because they have to edit the teaser in two forms (because the teaser is the same for registered/public visitors):
http://www.s2member.com/forums/topic/premium-content-teaser/

Same – to complicated for editors:
http://www.primothemes.com/forums/viewtopic.php?f=4&t=16079#p56160

boudewijn lutgerink seems to nag you about this for quite a while, but i can see no solution:
http://www.s2member.com/forums/topic/more-tag-not-working-correct/

I’m willing to edit my theme with php conditions, but i would like to keep it simple for editors.

Thanks for any help!!!

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Friday Feb 22nd, 2013 at 11:57 am #42849

I might use this code code within the loop to get the content above the –more– tag:

<!-- Display content above the more tag: -->
<?php if(strpos(get_the_content(),'id="more-')) :
global $more; $more = 0;
the_content(''); ?>
<?php endif; ?>

And of cause the whole content with this:

<!-- Display complete content: -->
<?php the_content(); ?>

But i need a condition which decides which one to display depending on the login-state.

This post seems to point in a similar direction:
http://www.s2member.com/forums/topic/converting-cms-to-show-teaser-content-easily/#post-33462

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