[theme-reviewers] index.php , home.php and blog-page.php

Chip Bennett chip at chipbennett.net
Thu Jun 26 16:06:38 UTC 2014


No, you can't make Template Hierarchy template files into custom page
templates.

Template Hierarchy template files are template files. Custom page templates
are custom page templates. Each should be used for their own, intended
purposes.

front-page.php is the Theme-defined custom static front page template file
home.php is the blog posts index template file
index.php is the default fallback template file for all contexts

All is explained here:
http://www.chipbennett.net/2013/09/14/home-page-and-front-page-and-templates-oh-my/


On Thu, Jun 26, 2014 at 11:02 AM, Imon Themes <imon.theme at gmail.com> wrote:

> can i make index.php as blog page
>
> mean i can use this code in index.php header
>
> <?php
>     /* Template Name: Blog */
>     get_header();
> ?>
>
> and make home.php as default font page
>
> thanks
>
>
>
> On Thu, Jun 26, 2014 at 9:56 PM, Chip Bennett <chip at chipbennett.net>
> wrote:
>
>> You cannot use blog-page.php custom page template for the blog posts
>> index. You must correctly implement the core Template Hierarchy, which uses
>> the home.php template file for the blog posts index.
>>
>> Users set up a static front page like so:
>>
>> 1. Create two static pages, which we'll call "Front Page" and "Blog"
>> 2. In Settings -> Reading, set "Front page displays" to "a static page"
>> 3. In Settings -> Reading, set "Front page" to "Front Page"
>> 4. In Settings -> Reading, set "Posts page" to "Blog"
>>
>> Now, in that scenario (the correct way to set up a static front page), if
>> the user assigns "blog-page.php" to the "Blog" page, which has been
>> assigned as the "Posts page", the "blog-page.php" custom page template will
>> be completely ignored. WordPress simply won't use it. WordPress will only
>> use the home_page_template() hierarchy, which is:
>>
>> 1. home.php
>> 2. index.php
>>
>> WordPress will simply never use a custom page template for the blog posts
>> index. The only way to get WordPress to use it is to provide different
>> setup instructions for configuring a static front page.
>>
>> All is explained here:
>>
>> http://www.chipbennett.net/2013/09/14/home-page-and-front-page-and-templates-oh-my/
>>
>>
>>
>>
>> On Thu, Jun 26, 2014 at 10:45 AM, Imon Themes <imon.theme at gmail.com>
>> wrote:
>>
>>> Hi,
>>> i have little confusion about this .can any body  clear it  ?
>>>
>>> 1)can i use those three page in my theme index.php , home.php and
>>> blog-page.php
>>>
>>> 2) can i use only index.php and  blog-page.php in my theme
>>>
>>> which one i can make as a defaults  font page in my theme ?
>>>
>>> thanks
>>>
>>> --
>>> *Imon Themes*
>>>
>>>
>>> _______________________________________________
>>> theme-reviewers mailing list
>>> theme-reviewers at lists.wordpress.org
>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>
>>>
>>
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>>
>
>
> --
> *Imon Themes*
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140626/91789965/attachment-0001.html>


More information about the theme-reviewers mailing list