Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing target of ‘register’ link on login page


  • footybible
    Participant

    @footybible

    I added define( ‘BP_REGISTER_SLUG’, ‘xxxx’ ); to change my registration address as I was having problem with spammers. This has worked beautifuly, except for one link – the ‘register’ one on the login page (next to ‘Lost your password’). I presume I have to change this on wp-login somewhere, but I’m a bit lost as to exactly where and how?

    Thanks.

Viewing 17 replies - 1 through 17 (of 17 total)

  • footybible
    Participant

    @footybible

    Is it something to do with do_action( ‘register_post’) ?


    footybible
    Participant

    @footybible

    @rogercoathup – I see this is something you have done before – any ideas?


    Roger Coathup
    Participant

    @rogercoathup

    @footybible – What’ve you changed your slug to? What does the link point to that is failing? Essentially, they need to be the same thing.

    Which page is giving you the problem? Is it a standard WP login screen as opposed to a BuddyPress one? Which theme are you using?

    Based on this, you can just go in and edit the appropriate template file to point the link to the right place. You won’t have to touch ‘actions’ – certainly not ‘register_post’ … which is something completely different.


    footybible
    Participant

    @footybible

    @rogercoathup – I’m using social theme. This is the page:

    http://www.footybible.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.footybible.com

    The ‘register’ link, in the bottom of the box, redirects to the home page instead of ‘/getinvolved’ which is my new slug. Not a huge problem, but annoying enough to put some people off I supect.

    Thanks


    Roger Coathup
    Participant

    @rogercoathup

    @footybible

    Ok, I don’t know the theme, but it looks like the designer has ‘gotten lazy’ and coded in a hard link to register.php rather than the register slug.

    You’ll have to get in there and find which template file it’s using, and change the link code to the register slug. The code you’ll be inserting is something like: http://pastebin.com/4n20tpx9

    Might be worth asking the theme designer to make the change.


    footybible
    Participant

    @footybible

    Cheers @Rogercoathup, I’ll have a look around


    govpatel
    Participant

    @govpatel

    @Matt I think its the wp-login.php in your root as that is default login page.


    Roger Coathup
    Participant

    @rogercoathup

    @footybible Yes, good spot by @govpatel

    Of course, that file is not going to be BuddyPress aware, so won’t know about BP_REGISTER_SLUG

    It’s not really a good choice for the registration / login screen for a BP site. If you are stuck working with that, rather than the standard BP login area, then you will have to hack your wp-login.php as @govpatel suggests


    footybible
    Participant

    @footybible

    Haha @rogercoathup this kind of brings me back to my orignal question :-) I’ve had a look at my wp-login.php and I’m not really sure what to change. I was hoping someone had come across this before, when changing their slug and it would be an easy answer


    govpatel
    Participant

    @govpatel

    @matt have you tried this Theme My Login plugin as it will redirect to login page on your own theme


    Roger Coathup
    Participant

    @rogercoathup

    @footybible – you can try replacing line 368 in wp-login.php with the code I put in the pastebin (above).

    However, I don’t know if this catches everything (give it a quick try!). There’s a lot of code / javascript going on in there, so fingers need to be crossed that this simple fix will do the trick.

    @govpatel – you are using the wrong @mention for Matt – you need to use the username rather than the displayed name. I know, it’s really un-user friendly!


    govpatel
    Participant

    @govpatel

    ok I am sorry I did not know that they were different as mine is same.


    footybible
    Participant

    @footybible

    Thanks @rogercoathup I’m not sure line 368 is the right place though (its currently blank in my login). Here is what my file looks like from line 353 onwards:

    // allow plugins to override the default actions, and to add extra actions if they want
    do_action(‘login_form_’ . $action);

    $http_post = (‘POST’ == $_SERVER);
    switch ($action) {

    case ‘logout’ :
    check_admin_referer(‘log-out’);
    wp_logout();

    $redirect_to = !empty( $_REQUEST ) ? $_REQUEST : ‘wp-login.php?loggedout=true’;
    wp_safe_redirect( $redirect_to );
    exit();

    break;

    case ‘lostpassword’ :
    case ‘retrievepassword’ :
    if ( $http_post ) {
    $errors = retrieve_password();
    if ( !is_wp_error($errors) ) {
    $redirect_to = !empty( $_REQUEST ) ? $_REQUEST : ‘wp-login.php?checkemail=confirm’;
    wp_safe_redirect( $redirect_to );
    exit();
    }
    }


    footybible
    Participant

    @footybible

    @govpatel – Yes it doesn’t make sense really, otherwise I would have chosen them the same when I signed up!


    Roger Coathup
    Participant

    @rogercoathup

    @footybible – have a look for a block with p id=”nav” . Replace the line in that block with the link to register


    footybible
    Participant

    @footybible

    @rogercoathup Excellent! There were 2 lines, one around 400, one around 600, which looked something like:

    <a href="”>

    I replaced them with the code you suggested and that did the trick perfectly! So much neater :-) Many thanks


    footybible
    Participant

    @footybible

    Hmm the code didnt paste properly, but you get the idea :-)

Viewing 17 replies - 1 through 17 (of 17 total)
  • The topic ‘Changing target of ‘register’ link on login page’ is closed to new replies.
Skip to toolbar