0

You can use front-page.php to create a static front page, it will override all other templates and static front page settings, but the problem is that you can't edit the front page then.

You can't edit the front page from inside WordPress, and add content to it, like you can with pages.

If I choose to create a new page and use it as the static front page from the reading options in WordPress, I am able to edit this page.

enter image description here

The point of a CMS system is to make it easy to manipulate content, using front-page.php I have to edit the code directly.

So why should I use front-page.php instead of adding a page and setting it to be the static front page in reading options?

closed as primarily opinion-based by Michael, cjbj, gmazzap Jun 22 '17 at 16:31

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Depends what you are trying to accomplish. I use front-page.php with Advanced Custom Fields, which allows me to still manage some of the homepage content within WP on an options page, while automatically displaying custom loops of various information in other spots on the homepage. If you're truly just trying to set up a static homepage, using a Page is preferable as you can use the Editor like you said. But for something partially dynamic, partially static, front-page.php is a useful tool. – WebElaine Jun 20 '17 at 16:01
  • @rarst once mentioned that front-page.php is suitable for private project that need a static custom homepage, that is not like going to be changed. Not suitable for most of the public projects. – Jack Johansson Jun 20 '17 at 17:55
  • @WebElaine Thanks for the info, I learned something new. – gummiost Jun 20 '17 at 20:17
  • @JackJohansson I was thinking the same thing, thanks! – gummiost Jun 20 '17 at 20:20
0

You would use the front-page.php template because it allows to have custom content and layout for your website's static front page.

You can edit content on your static front page from inside the WordPress admin if the front-page.php template contains the the_content() template tag or similar.

It really depends on what your content and presentation requirements are for your static homepage. Leaving out the front-page.php might be enough if you have basic content and presentation requirements. If your content and presentation requirements are more complex you might need to code or find a theme with a front-page.php template that better suits your needs.

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