Programming Tooling

Slimming Down (I): Your Own Landing Page

Mean­while, I have imple­ment­ed some fea­tures of bootScore. And I’ve prompt­ly over­loaded my site, as my read­er says: She recaps, that I — as far as she has under­stood — want to flex­i­bly write about sev­er­al dif­fer­ent core top­ics. This would end up in a list­ed mish­mash, of course! Shall she her­self pick out what belongs togeth­er?

Why does my home­page offer her such a long list of posts any­way? Why could­n’t she just see the most impor­tant things first? Could­n’t she call up the ‘search tools’ from the menu at all? In one fell swoop? And when she needs them, and not when the site means she does? Yes, she is right, my love­ly read­er! As usu­al! So let’s reduce our struc­ture:

[ en | de ]

Solution

  • Cre­ate a page mylap via the Word­Press back­end (= my land­ing page)
  • Cre­ate a page myplp via the Word­Press back­end (= my post list page)
  • Copy the index.php from bootScore-main under the name mylap.php into your Cild-Theme.
  • In the file mylap.php change the line The main template file to Template Name: mylap (my landing page).
  • Also, insert a spe­cif­ic name in the file home.php via Template Name: myplp (my post list page).
  • Acti­vate the but­ton a static page on Settings/Reading/Your homepage displays, assign the page mylap to the entry Home­page, and the page myplp to the entry Posts page
  • Edit the page mylap in the Word­Press back­end and replace Default Tem­plate in Page options with the tem­plate mylap.
  • Add the cre­at­ed page myplp to Your Appearance/Menus.

Background

So, you offer your read­er the option to call up an overview of all your posts from the menu: The added menu entry — lit­er­al­ly direct­ing to myplp — is now redi­rect­ed to home.php by Word­Press.

But if you call your site URL / domain, Word­Press does not dis­play home.php any­more, but the page mylap. As a deriv­a­tive of the bootSCore-index.php, it also still dis­plays a list of your posts. But — in the next step — you are free to design this page as your land­ing page — in the way you want. With­out lim­it­ing the func­tion­al­i­ty of your page. More about that lat­er.

Here are some traps you can avoid:

  • If you don’t give your php files unique tem­plate names, you will despair when assign­ing the Word­Press page mylap and the tem­plate mylap.php.
  • If you also assign the tem­plate home.php with the tem­plate name myplp to the Word­Press page myplp, you will con­fuse Word­Press: When you call the page myplp from the menu, Word­Press orga­nizes the file home.php by itself with­out any fur­ther work. You have already orga­nized this with the assign­ment under Settings/Reading/Your homepage displays.
To top