This topic has 5 replies, 3 voices, and was last updated 10 years by SQadmin.

  • Author
  • #7360
     iulianolaru
    Participant

    Dear users,
    I am seeking help regarding an issue that i cannot figure out. I have inserted in functions.php from the child theme, the code to redirect users after login to the profile page which is working.

    However, if you login with facebook, the redirection does not occur.

    What is there to do in order to have redirection for facebook logged in users as wel?

    Thank you in advance.

    With respect,
    Iulian Olaru

    #7395
     SQadmin
    Keymaster

    Hi, Logging in with Facebook just refreshes the page. You need to edit a theme file and specify you redirect url.
    File is: wp-content/themes/sweetdate/framework/functions/facebook_login.php
    Search for:
    window.location.reload();
    replace with:
    window.location = ‘http://mysite.com/redirect_url’;

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #7424
     iulianolaru
    Participant

    Dear sqadmin,
    Thank you for the solution which is supposed to work. However, i do not manage to get the right link to redirect the user, assuming of course that each profile has a different link.

    I have tried for example http://mysite.com/%username%/ http://mysite.com/$profile/ but with no result.

    Of course i replaced mysite.com with the proper domain name.

    What is there to do?

    #7432
     Anchora
    Participant

    i don’t use the fb-login, but maybe the
    buddypress-login-redirect plugin
    works for you too.

    #7456
     iulianolaru
    Participant

    Thank you Anchora. I will be trying the plugin later today but i would also like to know how buddypress works in this situation. Would less load using sqadmin’s instructions than installing another plugin.

    #7482
     SQadmin
    Keymaster

    Hi, If you want to redirect to their profile then you need to add the following line
    File is: wp-content/themes/sweetdate/framework/functions/facebook_login.php

    COPY CODE
    
    $redirect = bp_core_get_user_domain( $user_ID ).'profile/';
    

    after

    COPY CODE
    
    $logintype = 'login';
    

    You will find two occurrences.

    Then Search for:
    window.location.reload();
    replace with:
    window.location = user.url;

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?