abufrank (@abufrank)

Forum Replies Created

Viewing 1 replies (of 1 total)

  • abufrank


    For fixing the “page-not-found” when accessing a private forum, I found that when I placed Pascals code into the 404 page (great code by the way), the browser still flags the 404. So instead, I moved it to the functions.php file using the following:

    //redirect user to log in page if accessing forum from external link
    add_action( 'template_redirect', 'forum_redirect_from_external_link' );
    function forum_redirect_from_external_link() {
      $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
      $actual_link = explode('/',$actual_link);
      if($actual_link[3]=="forums" && !is_user_logged_in() ) {
        wp_redirect( home_url('your-forum-log-in-page-here') ); 

    I hope this was constructive… 🙂

Viewing 1 replies (of 1 total)