最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

frontpage - Setting index.php as a static home page without posts?

matteradmin52PV0评论

Is it possible (and good practice) to set the index.php file as my static home page, without any posts? In Settings > Reading Settings > Front Page Displays I don't see the option to select index.php as a front page option.

Is index.php not meant to be a static front page? Must I create a new page, such as home.php or splash.php, for my static front page?

Is it possible (and good practice) to set the index.php file as my static home page, without any posts? In Settings > Reading Settings > Front Page Displays I don't see the option to select index.php as a front page option.

Is index.php not meant to be a static front page? Must I create a new page, such as home.php or splash.php, for my static front page?

Share Improve this question edited Jan 26, 2017 at 17:27 lurning too koad asked Jan 26, 2017 at 17:17 lurning too koadlurning too koad 6292 gold badges7 silver badges13 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

I think you are confuse with templates from pages and posts. Please take a look at Template Hierarchy first. Both home.php and index.php in WordPress are templates. If you need a static page, create a Page instead a Post, and you can name it anything you want, the name is simply a slug, so you can call it Index or Home. Pages can be added into the Menu, and you can specify which one will be your Home (or what you means as the index.php) that will be shown up when you pointing your url to www.your-domain.

You should make a template file See here how to do this and then Select your custom template in WordPress page

then set this page as your Static Front Page.

Post a comment

comment list (0)

  1. No comments so far