PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Pro Login Widget via PHP tag

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Pro Login Widget via PHP tag

Postby Jason Caldwell » March 6th, 2011, 1:25 pm

Not all site owners like Sidebars in their theme. Sometimes it is nice to include widgets built for WordPress, directly into a custom theme file, or possibly into your /header.php file.

The latest release of s2Member Pro comes with documentation on how to achieve this with the Pro Login Widget for s2Member. Please check your WordPress Dashboard under:
s2Member -> API Scripting -> Login Widget via PHP.

Basically, you just do this:
Code: Select all
<?php echo s2member_pro_login_widget(); ?>
* This requires s2Member Pro v1.5.2+.

( Optional ) there are MANY configurable options.
Code: Select all
This function allows for the inclusion of the Pro Login Widget directly into a theme/plugin file.
This API function will return the HTML output from the widget function call.

Example usage: <?php echo s2member_pro_login_widget($options, $args); ?>

The $options parameter (array) is completely optional ( i.e. NOT required ).
It can be passed in as an array of options; overriding some or all of these defaults:

"title" => "Membership Login"            ——— Title when NOT logged in, or leave this blank if you'd prefer not to show a title.
"signup_url" => "%%automatic%%"            ——— Full Signup URL, or use %%automatic%% for the Membership Options Page. If you leave this blank, it will not be shown.
"login_redirect" => ""                    ——— Empty ( i.e. "" ) = Login Welcome Page, %%previous%% = Previous Page, %%home%% = Home Page, or use a full URL of your own.
"logged_out_code" => ""                    ——— HTML/PHP code to display when logged out. May also contain WP Shortcodes if you like.
"profile_title" => "My Profile Summary"    ——— Title when a User is logged in. Or you can leave this blank if you'd prefer not to show a title.
"display_gravatar" => "1"                ——— Display Gravatar image when logged in? 1 = yes, 0 = no. Gravatars are based on email address.
"link_gravatar" => "1"                    ——— Link Gravatar image to 1 = yes, 0 = no. Allows Users to setup a Gravatar.
"display_name" => "1"                    ——— Display the current User's WordPress® `Display Name` when logged in? 1 = yes, 0 = no.
"logged_in_code" => ""                    ——— HTML/PHP code to display when logged in. May also contain WP Shortcodes if you like.
"logout_redirect" => "%%home%%"            ——— Empty ( i.e. "" ) = Login Screen, %%previous%% = Previous Page, %%home%% = Home Page, or use a full URL of your own.
"my_account_url" => "%%automatic%%"        ——— Full URL of your own, or use %%automatic%% for the Login Welcome Page. Leave empty to not show this at all.
"my_profile_url" => "%%automatic%%"        ——— Full URL of your own, or use %%automatic%% for a JavaScript popup. Leave empty to not show this at all.

The $args parameter (array) is also completely optional ( i.e. NOT required ).
It can be passed in as an array of options: overriding some or all of these defaults:

"before_widget" => ""                    ——— HTML code to display before the widget.
"before_title" => "<h3>"                ——— HTML code to display before the title.
"after_title" => "</h3>"                ——— HTML code to display after the title.
"after_widget" => ""                    ——— HTML code to display after the widget.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate:

Is the s2Member plugin working for you? Please rate s2Member at
You'll need a account ( comes in handy ). Then rate s2Member here Image
User avatar
Jason Caldwell
Lead Developer
Lead Developer
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: No registered users and 2 guests