sfmPascal (@sfmpascal)

Forum Replies Created

Viewing 1 replies (of 1 total)

  • sfmPascal
    Participant

    @sfmpascal

    Hi, here is what I did for my site:

    1. Installed Allow PHP Execute
    2. Create a page, for example “forum profile”
    3. Add this code:

    
    <?php
    if (!is_user_logged_in()) {
      header('Location: /my-account/');
    } else {
      $current_user = wp_get_current_user();
      $user=$current_user->user_nicename;
      $newURL = '/forums/users/' . $user;
      header('Location: '.$newURL);
    }
    ?>
    

    4. Now when you go to this page, which you now can add to any menu location supported by your theme, if not logged in, will redirect to your login page, otherwise redirect to their form profile link.

    Jarrod

Viewing 1 replies (of 1 total)