Support » Plugin: Display Name Author Permalink » [Plugin: Display Name Author Permalink] Solution: Redirecting to a page rather than including 404.

  • Resolved Dominor Novus

    (@dominor-novus)


    If a user tries to access the profile page using an existing log-in name, a 404 (error) is presented.

    It may be just on my end but the 404 template is placed above the profile page i.e. if I scroll down.

    Instead, it’s possible to just redirect the user a specific page of your choice should you wish/need.

    Edit:

    display-name-author-permalink/display-name-author-permalink.php

    Find:

    // redirect template to use 404 template
    	function redirect_404() {
    		include(get_404_template());
    		return;
    	}

    Replace with:

    // redirect template to use 404 template
    	function redirect_404() {
    		//include(get_404_template());
    		//return;
                    wp_redirect( "http://www.yourwebsite/yourpage" );
    	}

    http://wordpress.org/extend/plugins/display-name-author-permalink/

Viewing 1 replies (of 1 total)
  • Dominor Novus

    (@dominor-novus)

    You could also pass a variable via the URL to trigger an error message on the intended page:

    wp_redirect( “http://www.yourwebsite/yourpage?error=yes” );

    You can use PHP’s GET function to grab the variable and use a condition to determine whether or not the error message is displayed.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Display Name Author Permalink] Solution: Redirecting to a page rather than including 404.’ is closed to new replies.