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

wp redirect

wp_redirect( $url );
Comment

PREVIOUS NEXT
Code Example
Php :: php connect to postgresql 
Php :: remove http / https from link php 
Php :: wordpress get the main url 
Php :: ubuntu update php 7.4 to 8 
Php :: laravel env pgsql 
Php :: function exists php 
Php :: php go to another page 
Php :: get wordpress page link by id 
Php :: how to get previous page name in php 
Php :: laravel Route::group definition 
Php :: laravel migration remove column 
Php :: php unit skip test 
Php :: random number generator in php 
Php :: reset wp query 
Php :: datetime difference in php 
Php :: how to get browser info in php 
Php :: laravel db seed specific class 
Php :: hide wordpress errors 
Php :: how to open server in php 
Php :: home url wordpress 
Php :: laravel collection flatten 
Php :: php artisan serve specify ip 
Php :: beautify var_dump 
Php :: public laravel htaccess 
Php :: laravel where creation is today carbon 
Php :: get yesterday date in php 
Php :: how to create controller in specific folder laravel 
Php :: wp get term link 
Php :: php create file html 
Php :: laravel transactions 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =