Atif
Atif

Reputation: 10880

Wordpress - Custom Blog Page

I would like to show a static front page and custom posts page. I created 2 page templates for this.

page-template-home.php //commented it as Template Name: Home Template)
page-template-blog.php //commented it as Template Name: Blog Template)

Then created 2 wordpress pages Home and Blog, then for the home page, set page template as Home Template and for the blog page, set page template as Blog Template.

And from Settings > Reading I set

Front page: Home
Posts page: Blog

Now the Home page is perfect, but the blog page seems to load index.php rather than page-template-blog.php

Any thing that I am missing or doing wrong ??

Upvotes: 0

Views: 1387

Answers (1)

TheDeadMedic
TheDeadMedic

Reputation: 9997

You're making a little work for yourself here - I would forget custom templates and instead utilise the template hierarchy - front-page.php for the home page (front page), and home.php for the blog page.

You'll still need to have your settings as you've described in your question, but the 'control' pages are now independent of the templates that render them :)

Upvotes: 1

Related Questions