admin管理员组

文章数量:1322012

This question already has an answer here: Homepage to serve content from my custom landing page [closed] (1 answer) Closed 4 years ago.

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 should read the content of my site/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/landing_page"));
    }
}

I also raise this concern to the plugin page.

TIA

本文标签: Homepage to serve the content of page created from a plugin