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.

Filter the next_post_link ?

Home Forums Community Forum Filter the next_post_link ?

Tagged: ,

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

Topic Author Topic
Posted: Saturday Aug 4th, 2012 at 7:54 pm #21162

On a single post in WP, I’m making links to the next and previous posts within the same category, but I only want the link to show up if the user has access to it. How can I do that?

I’m simply using:

<nav>
<?php next_post_link('&laquo; %link', '%title', TRUE); ?> 
<?php previous_post_link('%link &raquo;', '%title', TRUE); ?> 
</nav>

Thanks!

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Monday Aug 6th, 2012 at 11:14 am #21226
Eduan
Username: Eduan
Moderator

Hello there,

You can accomplish this with advanced PHP conditionals which you can find here:
Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals

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

Hope this helps. :)

Posted: Monday Aug 6th, 2012 at 8:55 pm #21287

Thanks Eduan–I think I should tweak my question slightly:

I need the code to fetch the next page link within the same category that IS accessible by the current member, whether via membership level or CCAP. If there’s nothing accessible, then don’t show any link. It’s not a simple can/cannot. That’s why I’m guessing it’s a filter of some sort and not a conditional.

Help?

Posted: Monday Aug 6th, 2012 at 9:15 pm #21288
Eduan
Username: Eduan
Moderator

In that case, you will need to check the s2Member codex for the necessary code. You would have to figure out and code some conditionals to do this for you (for example check if the user has a certain ccap etc.), so if you’re not comfortable with coding you might consider hiring a developer to do this for you over at jobs.wordpress.net.

Hope this helps. :)

Posted: Tuesday Aug 7th, 2012 at 7:10 am #21347

You may be able to do that with the query conditionals. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Advanced Query Conditionals[/hilite]

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