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.

Protect the_content() only?

Home Forums Community Forum Protect the_content() only?

This topic contains 2 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 4 months ago.

Topic Author Topic
Posted: Saturday Aug 18th, 2012 at 12:58 am #22413
Synergy WP
Username: synergywp

Hello,

I have posts that need to be access by everyone, even non-logged in viewers. However, for category XYZ, the the_content() needs to only display for level #2. The rest of the single.php template that I’ve coded needs to display, i.e. the_excerpt(). It’s there for teaser content/seo reasons.

Please tell me this vital component is available…

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Saturday Aug 18th, 2012 at 10:54 am #22447
Eduan
Username: Eduan
Moderator

Hello Synergy,

I suggest you check advanced PHP conditionals, which you can find under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals.

Here’s an article about conditionals:
Knowledge Base » s2Member® Conditionals

At the bottom it mentioned PHP conditionals.

Hope this helps. :)

Posted: Tuesday Aug 21st, 2012 at 6:47 am #22616

Hi Synergy.

I have posts that need to be access by everyone, even non-logged in viewers. However, for category XYZ, the the_content() needs to only display for level #2. The rest of the single.php template that I’ve coded needs to display, i.e. the_excerpt(). It’s there for teaser content/seo reasons.

If you’re talking about the excerpt being displayed to everyone in the Category archive, then you can just protect the posts in it with the Category restriction and adjust your Alternative Views protection to achieve that.

[hilite path]Dashboard -› s2Member® -› Restriction Options -› Category Access Restrictions[/hilite]
[hilite path]Dashboard -› s2Member® -› Restriction Options -› Alternative View Protection[/hilite]

If you’re talking about showing just the excerpt in the post itself, and not the rest, then you do need to work with the template using conditionals, as Eduán mentioned above. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals[/hilite]

I hope it helps. :)

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.