Coursepress Login redirect and registration shortcode.

1)I am using Coursepress, and have a custom login using wp_login_form on the homepage, which is supposed to redirect to the homepage after success. It works properly when the plugin is disabled, but when I activate the plugin, it redirects to a course press page. How do I fix this.

2) Can I get a shortcode for the login form and registration form?

  • Vinod Dalvi
    • WP Unicorn

    Hi @Andrew,

    I hope you are well today and thank you for your questions.

    1)I am using Coursepress, and have a custom login using wp_login_form on the homepage, which is supposed to redirect to the homepage after success. It works properly when the plugin is disabled, but when I activate the plugin, it redirects to a course press page. How do I fix this.

    This is because the CoursePress plugin uses its own setting for redirection after log in. You can just disable it by unchecking the "Redirect after login" option checkbox in the CoursePress settings from the following path.

    Admin Area -> CoursePress Pro -> Settings -> General -> Redirect after login

    2) Can I get a shortcode for the login form and registration form?

    Yes you can use the following CoursePress shortcode to achieve it.

    [course_signup]

    You will find more information about this shortcode and its parameters on the following path.

    Admin Area -> CoursePress Pro -> Settings -> Shortcodes

    Best Regards,
    Vinod Dalvi

  • Andrew
    • WPMU DEV Initiate

    I have unchecked

    Admin Area -> CoursePress Pro -> Settings -> General -> Redirect after login

    but still both
    wp_login_form(array('redirect' => site_url('/')))
    and
    wp_login_form()
    redirects to
    /courses-dashboard/

    I have no problem in hardcoding this, just tell me where to do it.

    I am using multisite FYI, and this issue is only on the parent site.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Andrew,

    Thank you for your detailed reply.

    It seems like an issue in coursepress "Redirect after login" option as it the option is not affecting the redirection functionality whether it is checked or unchecked therefore i have notified the plugin developer to troubleshoot it.

    In the meanwhile you can try using login_redirect filter with higher number of priority to redirect it to your custom page as described on the following page.

    http://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect

    You can also try using the following plugin to redirect it to custom page.

    https://premium.wpmudev.org/project/login-redirect/
    https://wordpress.org/plugins/peters-login-redirect/

    Thanks,
    Vinod Dalvi

  • Marko Miljus
    • The Incredible Code Injector

    Hi @Andrew,

    I am not able to reproduce the initial issue reported.

    When I add wp login form on a page like this:

    $args = array(
    				'echo'		 => true,
    				'redirect'	 => home_url(),
    			);
    			wp_login_form( $args );

    and have the redirect setting off (as you have), I am redirected to the home page after login.

    Could you please grant me access to admin so I can test it? Also, please make sure to put the code as I did in the above example just in case :wink:

    Cheers,
    Marko

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.