4

I'm so confused about this thing. I tried to figure this out for ours, but can't seem to find a solution. I'm currently working on a theme for a client, using the components business starter theme. I'm new to theme creation and still didn't quite get the hang of everything. Here is what I want to do:

Most of the time, you don't want to use the default homepage as the frontpage, but define a static page "Home". So I created a static page and went to Settings->Reading, to define my "Home" page as front page.

In any theme I know, including the standard WordPress themes and many themes I used so far, this will make the "Home" page be the front page.

However, in the theme I startet with, my frontpage stays empty. I don't get any content from my "Home" page there. This is a very basic starter theme, but I think this should be included right? It's a basic function from the WP backend.

I'm trying to get my theme to display the page that is set under "Front page" in the WordPress settings, but I just don't know how. When I change the theme to "twnetyfourteen", the page.php template is triggered instead of the index.php, when I view the homepage. In my theme however, it's still the index.php. How does WordPress decide, which one of both to chose?

1 Answer 1

4

Front page template logic is horrendous legacy mess. While back I wrote a very thorough front page cheatsheet, I still can't completely remember how it works.

You are right to notice that theme in your case doesn't behave in same way as other themes typically do.

If you run down specific template being used (plugin like Query Monitor can help with this) it's front-page.php, here it is in their github repo (and it seems to be moved in theme root, that's what generator thing does).

It is very uncommon for this file to ship in a public theme because it will always override any other front page template.

In this specific case it is being used to implement that "business" configuration of the theme, displaying hero image and testimonials (look at its source). It chooses not to output page content for that case, that's why it doesn't appear.

So in a nutshell it is niche theme, built for a specific purpose, in a way that public themes typically aren't.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.