• Resolved Rainerbird

    (@rainerbird)


    I have created a static homepage which is using a page called “home” and have created a blog page which, has the name “blog”.

    I have created a page template and have applied that to the homepage. The page template has the following at the top of it:

    <?php
    /**
     * Template Name: home.php
     */
    
    get_header();
    ?>

    So that all works well and my static homepage displays what it should be.

    However, my blog (posts) page, doesn’t work at all. All it does is show the homepage. I know it is a problem with my theme because if I apply another theme, the static homepage and the blog page work fine.

    Any ideas?

    Thanks for your time

Viewing 4 replies - 1 through 4 (of 4 total)
  • Goto Admin and click on “Settings > Reading“.
    Under “Front page displays” select the “A static page (select below)” radio button.
    Now you select your “Front page” and “Posts page” from the select drop down. And save.

    Thread Starter Rainerbird

    (@rainerbird)

    Sorry irengba, I have already done that.

    My front page is set as a page called “home”, which uses the template home.php shown above.

    My posts page is set as another page called “blog”.

    The homepage works and reads the home.php template properly.

    The blog page, which should display latest posts, shows the homepage instead.

    I hope you guys understand what I mean! But when I try another theme my blog pages shows the posts just fine.

    Your designated posts page (in this case your blog page) will use your theme’s index.php template file. I’d also strongly recommend that you rename your page template from home.php to something like homepage.php. home.php is a reserved filename on many systems and that may be causing confusion in your case.

    Thread Starter Rainerbird

    (@rainerbird)

    Thankyou esmi!

    Changing the home.php file to homepage.php has worked. There must have been a conflict!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using static homepage with a page template, seems to be breaking posts page’ is closed to new replies.