WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Front page display, static/posts page (5 posts)

  1. doubleu-z
    Member
    Posted 7 years ago #

    I've used WordPress in the past, but this is the fist time I've sat down to use it as a CMS -- also the first time I've successfully been able to get my site's theme to play nice with WordPress!

    Anyway, my problem is that I'm using the "Front page displays" option in Options > Reading, with a page template as the front page (called 'Home'), and another page template as the posts page (called 'Posts'). The 'Home' page template contains the code to display posts; so I've created a page in WordPress with the text for the Home page that I want, and given it the template 'Home'.
    Then, I created a (blank) page in WordPress and gave it a template with the code from 'index.php' (from Kubrick's theme folder) which displays all blog posts one after another.
    Then I made some blog posts, which are to be shown on the 'Posts' page.

    But when I go to the 'Posts' page in the site, the blog posts are shown, but with the template of the main page ('Home'). I know this because there are some obvious differences in these two templates. This is wrong...why does the 'Posts' page, which is assigned a separate template, use the 'Home' template? It should use the 'Posts' template, which has a different structure...

    I have no idea why this happens. I haven't messed up the template names, I've double-checked. What could it be?

    Help would be extremely appreciated!

    Thanks very much in advance,
    Waleed

    P.S. the site is currently on localhost, so there's no link to give you guys.

  2. doubleu-z
    Member
    Posted 7 years ago #

    I also tried changing the Posts page from Reading Options, but it still uses the template from 'Home'...

    I'm stumped; any help would be appreciated!

  3. doubleu-z
    Member
    Posted 7 years ago #

    Oh, man. I feel so stupid...

    The problem, as I just found out, was that the template file for 'Home' was named home.php. I changed it and then the 'Posts' page is now showing the right template.

    Hehe

  4. greggo
    Member
    Posted 6 years ago #

    Why does the fact that it was named home.php matter? I'm having the same problem and neither of my templates are named home.php. ?

  5. BeemerMonkey
    Member
    Posted 6 years ago #

    I posted a question to the forum earlier today about the exact same thing. I'm pretty convinced there's either a bug in the post page template process or the documentation is incorrect.

    I have a static home page (essentially) with it's own template and it works fine. But the file I choose for the posts page refuses to be anything other than the default index.php based template.

    Page only has a title, a blank content area and is assigned a template called "radical ideas." The slug is radical-ideas. The template file is radical-ideas.php. the radical-ideas.php template is just a duplicate of index.php with a few formatting changes.

    Everything should be set up correctly but it does not work.

    I know there's some issue out there that has to do with these "static" pages specified in the Reading tab like homepage and posts page having some issue with not retrieving the posts and needing an additional query to get them loaded. I don't really get it, but all the official docs indicate that you should be able to just duplicate the index.php template and use that duplicate as teh template in the write>page>template dropdown.

    But it doesn't work.

Topic Closed

This topic has been closed to new replies.

About this Topic