How to redirect WordPress home page to custom static HTML page

I am facing an issue while I upload the custom HTML page into my WordPress site.

The page all alone working fine as I put it in separate folder or if I change its name to index.php .
But then their arise a conflict between this custom page and the other WP theme pages .If I set this as a index.php page in theme or root WP .This page runs swiftly but other theme pages doesn’t work .Just show the same index page but with broken css

So all I want is not to broke my theme page as well to set custom html page it as my default Home Page
How can I achieve this ? I am using divi them

HTML page that I want to set as my Default Home page : http://filmyoze.com/Default

Rest of site : http://filmyoze.com

2 Answers
2

This code may help resolve the issue for this particular situation. Put this code in yor theme’s functions.php.

add_action('template_redirect', 'default_page');
function default_page(){
    if(is_home() or is_front_page()){
       exit( wp_redirect("http://path/to/your/html/file"));
    }
}

Replace http://path/to/your/html/file to exact url of html file.

I hope this helps.

Leave a Comment