WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Bug or "Feature"? "Posts" page won't use custom page template... (7 posts)

  1. miloandrew
    Member
    Posted 5 years ago #

    Hello,

    I seem to have stumbled on a bug in WP 2.6.1, and I'd like to see if anyone else has run across this.

    When making a Page in WP, you can specify a page template to base it off of, as outlined here.

    If I make a page (lets call it Blog) and then specify a custom template for it (say, BlogTemplate), then browse to the page slug for the Blog, the custom template is viewed just fine.

    BUT, if I go to the wp-admin/options-reading.php page and

    1. select that I would like a to use a static home page and then specify one (NOT Blog)
    2. and then specify the Blog page with the custom template for the Posts page

    The Blog page no loner picks up the custom template, but rather defaults to index.php.

    What I'm trying to figure out is:

    • Was index.php designed to be used as the "latest posts" template? (therefore removing the need for my "blog" custom template
    • OR

    • Is there a bug where the Post page won't read a custom template as specified in the Manage Page admin screen?

    Any help or clarification would be greatly appreciated.

    Thanks much,
    Andy

  2. miloandrew
    Member
    Posted 5 years ago #

    Hmmm. Some further sleuthing reveals that you may be able to force the issue by using

    load_template(TEMPLATEPATH . '/mycustomtemplate.php');

    in whatever page is specified as the Post page.

    See:

    http://codex.wordpress.org/Making_Your_Blog_Appear_in_a_Non-Root_Folder

    for more info.

    STILL though - I don't know if this is a bug or not. :)

    Thanks,
    A

  3. miloandrew
    Member
    Posted 5 years ago #

    Bump... Anyone?

  4. miloandrew
    Member
    Posted 5 years ago #

    Submitted bug #7715.

  5. miloandrew
    Member
    Posted 5 years ago #

    Well, that was a quick bug.

    It is now closed as NOT a bug.

    When you select a static front page, the following items are true:

    • is_front_page() is true on your designated static page
    • is_home() is now true for your designated "Posts" page
    • home.php is the active template for your "Posts" page.
    • Your "posts" page will no longer return a TRUE with the function is_page();

    So, so sum up this entire post:

    When a static page is selected as the front page, and a secondary page is designated as your "posts" page, a custom page template as designated on the page editor will not work for the post page. Instead, use home.php to change the layout of your post listing.

  6. aradams
    Member
    Posted 4 years ago #

    Thanks @miloandrew! This solved a similar problem I was having with a custom Posts page.

  7. fweeeb
    Member
    Posted 4 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.