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.

Remove "Join" button once logged in?

Home Forums Community Forum Remove "Join" button once logged in?

This topic contains 3 replies, has 3 voices. Last updated by  Eduan 4 years ago.

Topic Author Topic
Posted: Monday Dec 17th, 2012 at 6:27 pm #34868
rpvp
Username: rpvp

I have a “join” button in my header for prospective members. Once someone joins, is there a way to make that “join” button not appear on the header pages while they’re logged in?

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Dec 18th, 2012 at 9:37 am #34927
Eduan
Username: Eduan
Moderator

Hello rpvp,

For this you’re gonna need to use s2Member PHP conditionals, which you can find under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals, and you’re gonna need to modify your theme’s files in order to show it, or not depending if the user is logged in.

Hope this helps. :)

Posted: Sunday Dec 23rd, 2012 at 8:21 am #35425
JD Non
Username: Napalm44

I put my code into a sidebar widget.

A new visitor sees a ‘join’ button (leading to level1 access), and a ‘login’ button*.
A member who is not logged in only sees a ‘login’ button.
A logged in member sees neither.

*Open registration is off.

(I’m only a beginner at this stuff – it may be totally the wrong way to do things, but it seems to work)

[s2If !current_user_can(access_s2member_level1)]
Actions if a user is NOT  a member - ie show Join button
[/s2If]

[s2If !is_user_logged_in()]
Action if user is NOT logged in - ie show login button
[/s2If]
  • This reply was modified 4 years ago by  JD Non.
Posted: Sunday Dec 23rd, 2012 at 11:21 am #35435
Eduan
Username: Eduan
Moderator

If it works then it’s good. :) There doesn’t seem to be any problem with that syntax. :)

– Eduan

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