admin管理员组

文章数量:1291125

I want to display a custom post type page as my home page.

I have a site that I manage with lots of events that are custom post types. The company needed the site cloned as one of the events being spun out as as separate brand.

Currently I am displaying the event page in full width iFrame on the home page, which takes longer to load and has introduced other problems and is not great for SEO.

So the original site is like this

Home page
About
   Event 1 [custom post type]
       Event 1 child page [custom post type]
       Event 1 child page [custom post type]
   Event 2 [custom post type].....

So the new site is copy but with just one event and no other pages, the event home page needs to be the site home page.

Home page [i frame displaying event page]
   Event [custom post type]
       Event child page [custom post type]
       Event child page [custom post type]

Is there a way to override the Post ID and make a page display another page's content and ignore its own?

I want to display a custom post type page as my home page.

I have a site that I manage with lots of events that are custom post types. The company needed the site cloned as one of the events being spun out as as separate brand.

Currently I am displaying the event page in full width iFrame on the home page, which takes longer to load and has introduced other problems and is not great for SEO.

So the original site is like this

Home page
About
   Event 1 [custom post type]
       Event 1 child page [custom post type]
       Event 1 child page [custom post type]
   Event 2 [custom post type].....

So the new site is copy but with just one event and no other pages, the event home page needs to be the site home page.

Home page [i frame displaying event page]
   Event [custom post type]
       Event child page [custom post type]
       Event child page [custom post type]

Is there a way to override the Post ID and make a page display another page's content and ignore its own?

Share Improve this question asked Jun 7, 2021 at 9:09 lomokevlomokev 1831 gold badge2 silver badges10 bronze badges 1
  • this has been asked a few times here and there. Here is one: wordpress.stackexchange/questions/18013/… – Paul G. Commented Jun 7, 2021 at 9:45
Add a comment  | 

1 Answer 1

Reset to default 0

There are several ways to achieve a new front page, here it goes my favorite two.

  • if the theme already has a front-page.php, just overwrite it with the new code. if it doesnt create a front-page.php file and copy the code wanted over there. it should work like a charm.

  • create a template, create a page , set the page to that template and go to wp dashboard to appearance » customize » homepage settings » a static page » select your page.

本文标签: homepageDisplay another pagecustom post type as home page