最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Homepage to serve the content of page created from a plugin

programmeradmin5浏览0评论
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

发布评论

评论列表(0)

  1. 暂无评论