1
votes

WordPress:

  1. I am trying to create a Static Home Page without using index.php
  2. I have created a post page using index.php
  3. I have created a front-page.php for the Home-Page.

  4. I go to Setting>Reading>Front page: Home and then again Setting>Reading>Posts page: (Name of Post page)

  5. My Problem: Front-page showing "PostPage"

How to solve this issue?

2
question: why want to avoid using index.php as a home page? why not the contrary, set index.php as home page and a 'post-page.php' as post page? Aside to this, i guess the pages you are talking about are Wordpress pages (objects in the admin).. when you edit these pages, can't you choose the proper php file that is associated with this page? - Kaddath
at first I have tried this as you are saying. but in that case, post are not showing at the post page, posts are showing in home page - Shihab
just a guess here, but your 2 pages may be both using the same template file (index.php), if you exchange the file contents, they will still use the same file, content will change for both. If not done, you have to give a template name to front-page.php, and select it in the corresponding page when editing in the admin. More details here: developer.wordpress.org/themes/template-files-section/… - Kaddath
I am trying again from the beginning to create two new pages. -thank you - Shihab

2 Answers

0
votes

You should create a template name for your front-page.php.

Add this lines before the get_header();

<?php
/* 
Template Name: homepage(or everything you want)
*/ 
?> 

After that go to pages on wordpress and add to the page you want to set as frontpage the template homepage(or everything you want).

Go to Setting>Reading>Front page and set the page which has the template as front page.

0
votes

I found this answer. I made a copy of index.php and renamed it home.php. And its working nice!