After registration Redirect problem

This topic contains 2 replies, has 2 voices, and was last updated by  Guust 6 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #394952

    valdice14
    Free User
    Post count: 36

    Hi to all, sorry in advance for my bad english, i’m new to geodirectory but i found your work really great!
    I’m using your plugin with supreme theme to listing coaches instead of shops, for now all is almost working, i’m going to buy multilocator and andvanced searh addons to fill my needs.

    At the moment i’m using Stiofan code below to redirect users after login/registration:

    
    
    // redirect after login/reg
    add_filter('login_redirect','my_login_reg_redirect',10,3);
    function my_login_reg_redirect($redirect_to, $requested_redirect_to, $user){
      //only redirect if not being redirected somewhere important like back to add listing page.
      if( trailingslashit($redirect_to) == trailingslashit(home_url())){
        $redirect_to = home_url('/add-listing/');
      }
      
      return $redirect_to;
    }

    All works great but my needs is to redirect users only after registration, not after login.
    So i found this code also in this community:

    
    
    add_filter('geodir_login_url','_my_geodir_login_url',10,3);
    function _my_geodir_login_url($login_url,$args,$gd_page_id){
    if(isset($args['signup'])){
    //change the url to whatever you want.
    $login_url = '/add-listing/';
    }
    return $login_url;
    }

    But this not working at all redirecting users on last page visited before registration and on rapid link register on the header box i got a blank page with:

    [an error occurred while processing this directive]

    This is my testing website
    Any help will be appreciated, thanks in advance.
    Valdo

    #394969

    valdice14
    Free User
    Post count: 36

    Hi there, i solved with my friend contribution, i need just to put absolute link instead of relative using second code I’ve posted, thanks anyway

    #394988

    Guust
    Moderator
    Post count: 29970

    Thanks for letting us know 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket