Tag Info

New answers tagged

0

If you're willing to try another plugin, I suggest using Force Login. It's a simple lightweight plugin that will require all visitors to login. Once the plugin is installed and activated, add the following code to your functions.php file to change your site's login URL to point to your custom login page: function my_login_page( $login_url, $redirect ) { ...


0

Could you not just add a form with a target of _blank?e.g. <form action="myfile.php" target="_blank" method=""> <input type="submit" value="Go There" /> </form> Would that not work?


1

Nop, its not possible at all with wp_redirect(). One have to find other way around to accomplish it.


0

The correct way to do this is using the template_redirect hook by adding a function to your functions.php: function redirect_to_home() { if(!is_admin() && is_page('2')) { wp_redirect(home_url()); exit(); } } add_action('template_redirect', 'redirect_to_home');


-1

WP_REDIRECT is the function that you need to use for redirecting in wordpress. It can be used like : wp_redirect( $location, $status ); exit; //$location is required parameter. It is used to give the target url to which page will get redirected. //$status is optional. It is used to set status code. Default is 302 You can use this function to redirect ...


-1

add_action( 'init', function() { if ( 0 === stripos( $_SERVER['REQUEST_URI'], '/page_id=2' ) ) { wp_redirect( home_url(), 301 ); exit; } } Put this code in a mu-plugin or in your theme's functions.php file


-1

Locate page.php (assuming you've created it already). After this line <?php get_header(); ?> add the following code: <?php if(is_page('2')) { wp_redirect( home_url(), '302' ); } ?> In the code above, is_page('2') is actually the ID of your page as you've specified in your example.


0

The issue is that the browser doesn't pass the hash value in the request, it is parsed by the browser itself. Since the server doesn't know about the hash it can't forward it along after the login. You do have access to the hash with javascript though...Without seeing your code I can't give you a specific answer but something like this would probably work: ...



Top 50 recent answers are included