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 :: php sort array by value length 
Php :: calculate 18 years back date in php 
Php :: laravel route logout 
Php :: php text to html 
Php :: why pusher not working in laravel 
Php :: file put contents append 
Php :: laravel-ckeditor 
Php :: php required 
Php :: php get ip client 
Php :: php fix array keys 
Php :: laravel redirect with message to section 
Php :: file storage laravel 
Php :: php foreach random 
Php :: drupal load all nodes of type 
Php :: php add array values with same keys 
Php :: How do I convert a string to a number in PHP? 
Php :: Line : 83 -- syntax error, unexpected end of file php 
Php :: codeigniter 3 or where not in 
Php :: create listener using laravel 
Php :: for each php 
Php :: wordpress get post type 
Php :: remove seconds from time php 
Php :: Yii::app()-request-get yii1 
Php :: laravel save photo in both local and database 
Php :: xampp to test on mobile 
Php :: string to array in php 
Php :: exec output php 
Php :: laravel list of tables 
Php :: laravel pass variables to view 
Php :: php get date between two dates 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =