Tip:
Highlight text to annotate it
X
How do I design my home page?
Usually, you want your home page to be a special place.
Most people like to have a slideshow here.
You also may want to show some selected pages as teaser boxes.
WordPress looks for a special file named front-page.php.
If this file is present in your theme directory, it will be used as front page.
For the twentytwelve theme, it's stored in the directory page-templates, so we will use the same structure in our child folder.
We also need to create a regular page in the WordPress back end.
Select the template 'Front Page Template' for this page and give it a name that you can easily remember, like 'home'.
Then you go to 'Settings, Reading' and select this page as your front page.
When you edit the front-page.php file, you can now decide how it should show your front page.
In this case, I'll insert a special code to show my meteor slides.
This is just a plugin that I have already installed,
and I have already added some slides,
so I just need to add the code here, to show it on the page.
I also want to show some teaser texts on the page, so I'll add three additional divs.
I'll give them the CSS class teaser,
and I'll also add the class first and last for the first and last teaser box, to make styling easier.
Then I'll add some CSS rules in my stylesheet, so give them a unique look.
Inside the divs, I want the teaser texts.
To make it easy, I use the function get_page_by_title() and name these pages teaser1 teaser2 and teaser3.
And I'll show the content of the page in each of the div sections.
Now I just need to create the teaser pages.
And, when I call my site, I'll see my new front page with the slideshow and the teaser boxes.
There is one detail that we have to fix now.
As you can see, the teaser boxes will not have paragraphs added automatically, like you see on regular pages and posts.
This can be fixed easily, by applying the filter for 'the_content' before you show your content on the page.