Embedding Login Widget In a Page

Hello Forum, I hope all are doing well today. My question today is about how to configure and embed my login widget in a page. I want to embed my login widget in my registration thank you page. I want to apply a member level url redirect to the login widget so that it redirects the user to a login thank you page created for their specific membership level. I don’t know much about php coding so I am asking for help getting this task done. I have installed the EZphp plugin, so I am ready to put the code in my WP pages. I am really interested in learning how to edit the code for my purposes and apply it to my page. do I put the code in the WP Code Editor? Can you help?

Example PHP Code Using s2member_pro_login_widget()

<?php echo s2member_pro_login_widget(); ?> **"Where do I put this string of code"?**

More Elaborate Example w/ Configuration Options/Args

<?php echo s2member_pro_login_widget( array( 'title' => 'Membership Login', 'signup_url' => '%%automatic%%', 'login_redirect' => '', **"Is this where I put my login welcome page redirect url for multiple levels"?** 'logged_out_code' => '', 'profile_title' => 'My Profile Summary', 'display_gravatar' => '1', 'link_gravatar' => '1', 'display_name' => '1', 'logged_in_code' => '', 'logout_redirect' => '%%home%%', 'my_account_url' => '%%automatic%%', 'my_profile_url' => '%%automatic%%', ), array( 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', 'after_widget' => '', ) );

I think I figured It out! I’m going to play with it a bit to see if I can do it.

It looks like Im going to need some help after all. Can you help?

‘login_redirect’ => ‘’, “Is this where I put my login welcome page redirect url for multiple levels”?

Yes, that’s the one. :slight_smile:

It looks like Im going to need some help after all. Can you help?

What do you need? Could you show me what you tried and what the problem was?

Hi Cristian, I hope you’re doing well. Yes, what I did was edited the Example PHP Code Using s2member_pro_login_widget the longer more elaborate code with my redirect URL and gave it a new title. I then tried to paste the code to one of my after registration thank-you pages. I think that Is where I ran into problems. If the coding is correct. where exactly do I put the php code? I opened the WP code editor of my page and pasted the code there. When I checked the page the login widget wasn’t on the page? What am I doing wrong?

<?php echo s2member_pro_login_widget( array( 'title' => 'DIY IM Membership Login', 'signup_url' => '%%automatic%%', 'login_redirect' => 'https://diyinternetmarketer.com/login-welcome-page-level-%%current_user_level%%/', 'logged_out_code' => '', 'profile_title' => 'My Profile Summary', 'display_gravatar' => '1', 'link_gravatar' => '1', 'display_name' => '1', 'logged_in_code' => '', 'logout_redirect' => '%%home%%', 'my_account_url' => '%%automatic%%', 'my_profile_url' => '%%automatic%%', ), array( 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', 'after_widget' => '', ) );

Did you verify that PHP is actually working on your page? Try this test:

<?php echo "Yup, it's working."; ?>

By the way, you may find it simpler to use the s2member-Login shortcode. https://s2member.com/kb-article/s2member-login-shortcode-documentation/

‘login_redirect’ => ‘https://diyinternetmarketer.com/login-welcome-page-level-%%current_user_level%%/’,

You copied that from the Login Redirection URL box, right? %%current_user_level%% is not going to work in the widget. https://s2member.com/kb-article/pro-login-widget/#toc-3610725f

Besides, if you configured the Login Welcome already, that’s what’s going to be used. This login_redirect in the widget would override the default, but that’s not what you want, you do want the default. Am I wrong?

First get the widget working, then test it without the redirection, and see if behaves as you want it.

I hope that helps. :slight_smile:

Okay, will do and let you know the results.

1 Like

Hi Cristian, I hope you’re doing well today. I wanted to let you know that thanks to your patience and help I seem to have the registration and login forms working correctly now. I will now go on to add content to my membership pages and levels. I know that I will be looking for your help again probably sooner than not. But before that I have to let you know that I really appreciate your help. I couldn’t have gotten this much doe without your instruction I’m grateful :smiley: So, until my next issue.
Tony

1 Like

That’s wonderful, Tony! I’m so glad! I’m happy I could help you. :smiley:

Please, don’t hesitate to let me know if you need help again.

Oh, and if you feel like it, I’d really appreciate it, and it’d help me a lot, if you could take a moment to leave a review over at WordPress. :pray: https://wordpress.org/support/plugin/s2member/reviews/?filter=5