Home Forums Plugin Support WP User Frontend Pro Login Redirect

This topic is: resolved

This topic contains 11 replies, has 2 voices, and was last updated by  MareVisie 3 years, 8 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #61328

    MareVisie
    Member
    Post count: 83

    Hi,

    I am trying to set up a redirect for people that succesfully log in to my site. I found this thread on how to redirect after login: https://wedevs.com/support/topic/redirect-login-page-after-sign-in/, however the information no longer seems to be valid (I can't find the files, nor the lines, specified there).

    I found the login.php in the /includes/pro/ folder.

    #63782

    Nayem
    Moderator
    Post count: 6480

    Hello,

    Now by default seller will redirect to their dashboard after login. Please update to the latest version of Dokan 2.4.

    Thanks.

    #64133

    MareVisie
    Member
    Post count: 83

    Hi Nayem,

    Thank you for your reply. Sadly, I don't use Dokan, I am currently using Zerif Lite v. 1.8.2.2 and I intend to keep it that way.

    Is there a way to change the login redirection to a specific page (I want to use a page that shows the latest posts). This post seems to have solved it in the past, however the code has changed so it's no longer relevant.

    #64135

    Nayem
    Moderator
    Post count: 6480

    You can try this code-

    add_filter('wpuf_login_redirect', 'login_redirect');
    function login_redirect($redirect){
    
     $redirect =	home_url('/your own page') ; 
    return $redirect;
    }
    #64137

    MareVisie
    Member
    Post count: 83

    Thank you for your incredibly fast reply.

    Two questions:

    1. where do I implement this code? I have read up on the basics of hooks and filters, but I don't know how to safely implement this code without harming the website or intervening with the update process.
    2. How can I extend the URL to take languages into account?
    #64163

    MareVisie
    Member
    Post count: 83

    I tried creating a folder login-redirect in wp-content/plugins/ with a file named login-redirect.php with the following code:

    
    <?php
            /*
            Plugin Name: Login Redirect
            Description: This plugin regulates the redirect after login using WPUF
            Author: Sjors Hijgenaar
            Version: 0.1
            */
    
            add_filter('wpuf_login_redirect' , 'login_redirect');
    
            function login_redirect($redirect){
                    $redirect = home_url( '/index.php/nl/blog/' );
                    return $redirect;
            }
    ?>
    

    However, the plugin doesn't show up in my Plugin Directory in my Admin Panel. Any thoughts?

    #64199

    Nayem
    Moderator
    Post count: 6480

    Hello,

    I did not think that you will use those code as a plugin. You can put those code in your child theme function.php file.

    Thanks.

    #64200

    MareVisie
    Member
    Post count: 83

    Hi Nayem,

    That explains a lot, thank you.

    Could you verify for me that this doesn't get lost when the Theme is updated?

    #64225

    Nayem
    Moderator
    Post count: 6480

    If you will create a child theme then you will not loose any data during update.

    #64233

    MareVisie
    Member
    Post count: 83

    The child theme will re-set most of my content. Is there a way to make sure the website stays as it is, with the child theme active?

    #64234

    Nayem
    Moderator
    Post count: 6480

    Then please create a backup for those code. After updating the theme insert those code again.

    Thanks.

    #64239

    MareVisie
    Member
    Post count: 83

    I used this plugin to keep all the customizer data between parent and child theme and this thread for my child theme. I only had to change a few menu structures back around, but the code supplied by Nayem works brilliantly.

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

The topic ‘Login Redirect’ is closed to new replies.