• Hi All
    I’ve created a theme that I wan’t to distribute and I’ve created a choice of two landing pages for the home page. At the moment the instructions for those using the them are to go to pages and create a new page, then under Page Attributes -> Template select one of the two landing pages as a template. Then in settings -> reading, check “static page” and this page can be selected as the home page where it now appears in the drop down menu. My question is then, is it possible to just have the steps…
    1. Install theme
    2. Go to Settings -> Reading and select one of the two landing pages.
    That is, the Home Page menu is automatically populated one way or another with my two landing pages?

    Many thanks

    Vince

    • This topic was modified 6 years, 6 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not a Developing with WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • Well, you know it doesn’t work that way.
    However, if you make the difference between the two templates into Customizer options, and merge the two templates to check those options, you can call the new template front-page.php. And it will work that way. Be sure that the template also handles the case where Latest Posts is chosen to be Home.

    If you leave them as Page templates, the user can have many landing pages, instead of just one as Home.

    Moderator bcworkz

    (@bcworkz)

    Home Page menu is automatically populated one way or another with my two landing pages?

    Not really. It’s populated by all published pages, not by which templates you have. When your theme is first activated they’d all be using the default page.php template (singular.php or index.php if there is no page.php). When WP is first installed, the only pages are the initial sample page and the privacy statement outline. Don’t confuse WP pages (content saved in the DB) with page templates provided by your theme. While interrelated, they are not the equivalent.

    There can only be one home page per site. There can be any number of landing pages for various marketing campaigns.

    Thread Starter etemplates

    (@etemplates)

    Thanks to both of you for the insights.

    Vince

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Default home pages’ is closed to new replies.