Page 1 of 1
how do I put name in welcome page?
Posted:
October 25th, 2011, 7:34 am
by ilana-av
Hi
I would like to know where and how I could take the name of my subscriber ,
in order to put it on the welcome page?
thank you
ilana
Re: how do I put name in welcome page?
Posted:
October 25th, 2011, 8:43 am
by Eduan
! |
Before you read any further, you should install this handy plugin: PHP Execution. You'll need to have this plugin installed to use PHP code in Posts/Pages. |
You can use one of these three:
- Code: Select all
S2MEMBER_CURRENT_USER_FIRST_NAME
This will always be a (string) containing the current User's First Name. Empty if not logged in.
<?php echo S2MEMBER_CURRENT_USER_FIRST_NAME; ?>
This may output something like: John
( or whatever their first name is )
---- s2member Shortcode Equivalent ----
[s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]
S2MEMBER_CURRENT_USER_LAST_NAME
This will always be a (string) containing the current User's Last Name. Empty if not logged in.
<?php echo S2MEMBER_CURRENT_USER_LAST_NAME; ?>
This may output something like: Smith
( or whatever their last name is )
---- s2member Shortcode Equivalent ----
[s2Get constant="S2MEMBER_CURRENT_USER_LAST_NAME" /]
S2MEMBER_CURRENT_USER_LOGIN
This will always be a (string) containing the current User's Username. Empty if not logged in.
<?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>
This may output something like: johnsmith22
( or whatever their login/username is )
---- s2member Shortcode Equivalent ----
[s2Get constant="S2MEMBER_CURRENT_USER_LOGIN" /]
Also remember to put them in the HTML editor
Re: how do I put name in welcome page?
Posted:
October 25th, 2011, 8:50 am
by ilana-av
thanks allot
did you mean that I should actually write -Hello S2MEMBER_CURRENT_USER_FIRST_NAME
and the S2MEMBER will put in my welcome page the name of my sbscriber?
like this- Hello Jhon ?
if so why do I need PHP ?
THANKS
ILANA
Re: how do I put name in welcome page?
Posted:
October 25th, 2011, 8:58 am
by Eduan
Yes, but you gotta have
PHP Execution and you gotta put
- Code: Select all
[s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]
Exactly like that.
Re: how do I put name in welcome page?
Posted:
October 25th, 2011, 9:15 am
by ilana-av
Hi Eduan
Do you mean that I should also write " code:select all"?
or only the green text?
ilana
Re: how do I put name in welcome page?
Posted:
October 25th, 2011, 9:24 am
by Eduan
Only the green text, "CODE: SELECT ALL" is what you click on to select all the code.
Re: how do I put name in welcome page?
Posted:
October 26th, 2011, 12:07 am
by Cristián Lávaque
You only need the PHP execution plugin if you use PHP code in your post, not if you use the WordPress shortcode. So you can just do:
- Code: Select all
Welcome [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]!
WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API ConstantsI hope this helps.