Homepage to serve the content of page created from a plugin

Question

NOTE: This is a duplicate issue since I have posted it to a wrong channel. I just figured out this community of wordpress here in SO.

I am new to wordpress and trying to achieve something.

I have a landing page created from a plugin and I want my homepage to serve the content of that landing page without any redirection.

E.g. site.com should read the content of my site.com/landing_page

Is there any way to do it programmatically? Or via dashboard?

The code below does not satisfy my condition since the homepage is redirected to the landing page itself.

add_action('template_redirect', 'default_page');
function default_page(){
    if(is_home() or is_front_page()){
       exit( wp_redirect("site.com/landing_page"));
    }
}

I also raise this concern to the plugin page.

TIA

0
John Rey Tanquinco 4 months 0 Answers 14 views 0

Leave an answer