Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wp_redirect to home page

function redirect_to_home() {
  if(!is_admin() && is_page('2')) {
    wp_redirect(home_url());
    exit();
  }
}
add_action('template_redirect', 'redirect_to_home');
Comment

redirect wordpress

add_action( 'template_redirect', 'redirect_to_other_page' );
function redirect_to_other_page() {
    if ( is_page( 143 ) ) {
	  
      wp_redirect( '"'.home_url().'/services/messenger/"', 301 );
      ///wp_redirect( 'example.com/page', 301 ); 
    exit;
    }
}
Comment

wp redirect

wp_redirect( $url );
Comment

PREVIOUS NEXT
Code Example
Php :: laravel model update 
Php :: php date first day of month and last month 
Php :: change key with the value php 
Php :: get substring after character php 
Php ::  
:: laravel log could not be opened fix 
Php ::  
Php :: php get day number 
:: convert numeric array to string array php 
Php ::  
:: php mysql search database and display results 
:: how to play sound with php 
Php :: construtor php 
Php ::  
Php :: php switch statement 
Php :: laravel redirect to intended page after register 
Php :: allowed memory size of bytes exhausted composer 
Php ::  
Php ::  
:: check for an existing user laravel eloquent 
Php ::  
::  
Php :: socialite laravel 7 
::  
Php :: php get highest key in array 
Php :: how to share a helper globally laravel 
Php :: Fatal error: Exception thrown without a stack frame in Unknown on line php 
Php :: composer require no cache 
Php ::  
Php :: wordpress logout 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =