By default, WordPress shows the latest posts, but what if you wanted the homepage of your website to display the same page every time. This “static front page” look is common for users desiring static or welcoming information on the front page of the site.
There are two ways to add Static Front Page
- Go to the Pages > Add a New Page dashboard page. This option is on the left sidebar in your WordPress Dashboard.
Name the page “Home” and type whatever you want for the content your homepage.
- Create a template called as front-page.php and add whatever you want to add here. This can be static or dynamic as per your needs.
- Add another page called “Blog” and leave the content of the page as blank.
- Now go to the Settings > Reading Settings dashboard page.
- By default :Your Latest posts is chosen. Select “A Static Page (Choose Below)”.
For “Front Page”, choose the “Home” page you just created.
For “Posts Page”, choose the “Blog” page you created.
That’s all, your static page along with normal log page is created.
Let’s have a look at second approach.
- Create a new template in WordPress file directory and name it as home.php . Due to naming convention and prioritization, home.php will be provided priority over index.php. Here is simplest home.php .
<?php /** Template Name: Home Page */ get_header(); ?> <p>Add any functionality here. This is new blog home p</p> <?php get_footer();?>
- Copy index.php into new file called as blogindex.php and add following lines at the top of the file.
<?php /** Template Name: Blog Index Page */ ?>
Here, you would need to add WP_Query as well.
- Create a page called as “blog” and assign a template “Blog Index Page” to it. Please not that, in this approach, you don’t have to make any changes in Settings > Reading
Once above is done, your static home page along with blogs page is ready.