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.

skip login welcome & membership options pages

Home Forums Community Forum skip login welcome & membership options pages

This topic contains 5 replies, has 3 voices. Last updated by  mohi khanna 3 years, 6 months ago.

Topic Author Topic
Posted: Saturday Mar 3rd, 2012 at 1:24 am #7151
Gary Cribb
Username: gaza686

I am trying to figure out how to not have a membership options page come up when clicking a #0 protected library but rather just have the login/reg form apear instead. Also want this to redirect to the gallery page that was #0 protected instead of the Login Welcome page. I am a beginner at this so appologize if my question has been answered already.

thanks!

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Saturday Mar 3rd, 2012 at 9:51 am #7166
David Welch
Username: dwbiz05

Well under s2member->general options->login welcome page you can select any page in your wordpress install, OR if you want, you can put in your own url to another (protected) page.

Avoiding the membership page is a little more tricky. The easiest way I know of is to “hook” into the s2member code with something like this.

Create a directory in your wp-config called mu-plugins (if it’s not there).
Then create a file called s2-hacks.php (if it’s not there).
Then add this code to s2-hacks.php:

<?php

function no_mp_redirect(){
	wp-redirect(site_url('wp-login.php?action=register'));
}

add_action('ws_plugin__s2member_before_membership_options_page','no_mp_redirect'); //This is a hook
add_action('ws_plugin__s2member_before_wp_redirect_w_mop_vars','no_mp_redirect'); //This is another hook in the same class... I'm not sure which is the best to use.

?>

That should do what you want. I haven’t tested it thoroughly though so let me know if something weird happens! :)

Dave

Posted: Friday Mar 16th, 2012 at 3:22 am #8344
Gary Cribb
Username: gaza686

Thanks for your reply, sorry for the delayed response. I am unclear as to how to do this step:

Create a directory in your wp-config called mu-plugins (if it’s not there).

Thanks!

Posted: Friday Mar 16th, 2012 at 3:31 am #8345
Gary Cribb
Username: gaza686

Hey Dave, Here is the site info, I am getting a fail to create directory probably because I have no idea what I am doing :) so please any advice is much appreciated.

Thanks

http://www.cool-sf.com want the “members galleries to be behind a sign-in wall then on to the galleries..

Posted: Friday Mar 16th, 2012 at 1:33 pm #8380
David Welch
Username: dwbiz05

LOL… It would help if I gave you the right directory… should be wp-content… not config… sorry about that.

I usually do this through an ftp program like filezilla or through the cpanel file system provided by your hosting company.

If you would like, I could take a look at the back end / control panel.

My contact email is in my profile.

Dave

Posted: Monday Jul 8th, 2013 at 5:41 pm #53130

I have used the above code.

<?php

function no_mp_redirect(){
	wp-redirect(site_url('wp-login.php?action=register'));
}

add_action('ws_plugin__s2member_before_membership_options_page','no_mp_redirect'); //This is a hook
add_action('ws_plugin__s2member_before_wp_redirect_w_mop_vars','no_mp_redirect'); //This is another hook in the same class... I'm not sure which is the best to use.

?>

but i get the error –
Fatal error: Call to undefined function redirect() in /home/content/43/11414443/html/playandwin/wp-content/mu-plugins/s2-hacks.php on line 4

The i searched on google and found that function is actually wp_redirect in place of wp-redirect. So i changed code to following-

<?php

function no_mp_redirect(){
	wp_redirect(site_url('wp-login.php?action=register'));
}

add_action('ws_plugin__s2member_before_membership_options_page','no_mp_redirect'); //This is a hook
add_action('ws_plugin__s2member_before_wp_redirect_w_mop_vars','no_mp_redirect'); //This is another hook in the same class... I'm not sure which is the best to use.

?>

Now when i navigate to authenticated pages in site, then error does not come, but yet membership options page shows.

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