Home or front-page ?

[ad_1]

I am developing my first theme, with help of chatgpt. It says that for home page, i should use front-page.php instead of home.php. it says home.php isjust for displaying blog posts although i can also have widgets on it and place what i want in those, butit says front-page.php is better 8f i want more flexibility but in that case i need to hard code things into that page instead of modular widget approach of home.php. My first question – and i couldn't communicate with chatgpt on this- why does file name matter? I mean as long as we place anything we want in it…. my second question is what do you prefer and do when you write themes? Do you use or does it make sense to use home.php with lot of widgets or front-page.php is better? I want the theme to have many fields, and be able to show many different types of things in those many fields… it will be for my site for now, unless i am later sure that it is good and i may sell.

[ad_2]
3 Comments
  1. You should look up the WP Template heirarchy. WordPress has a bunch of core files/templates that are used for different aspects of the site. Of course you don’t NEED to use them and can create your own, it’s just way easier to use them for their specific purposes.

    It’s confusing, but Front-page.php is the file WordPress will look to (by default) if you set your Home Page to be a static page in Settings. So if you created a paged, called it “My Home Page” went to settings and changed it so that your home page was a static page and chose “My Home Page”. WordPress will use front-page.php to render it by default.

    Home.php (stupid horrible name) is what WordPress looks to by default if you have your front page set to “Show BLog Posts”. That is the default. So by default WordPress will look for home.php to render the home page in that case.

  2. Home.php is more like your blog roll/archive. If all you’re gonna do is create blog posts this approach is fine

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer