• robgnyc

    (@robgnyc)


    I’ve got my install set up with a static homepage using a custom template called home.php. The posts page is set to my news page which is set to use the default template per the WordPress instructions.

    I would like to edit the template that the posts page uses but can’t seem to figure out how to do this. Basically I want a custom template for my posts page and I want to retain the News page highlighting in the top menu when I click through to a single post.

    Is this possible? Is there another way to do this? I had it set up as a regular page and then had it just pulling in the last few posts with query_posts but then when I clicked through, I lost the highlighting of the News top menu item.

    I guess alternatively can the single page retain the news top level menu highlighting appearing as a drop down menu?

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    I’ve got my install set up with a static homepage using a custom template called home.php.

    I would strongly recommend that you start by changing the name of your custom template to homepage.php and using WP to define a static front page

    Thread Starter robgnyc

    (@robgnyc)

    This worked. Just to follow up with what I did:

    Changed the name of the template that my homepage was using to homepage.php from home.php (also changed the name of the template at the top of the template php file).

    Went into WP and had my static homepage use the template homepage.

    Set my blog posts page to use my news page.

    Set the news page to use the default template.

    Renamed my news template to home.php.

    Re-uploaded home.php.

    Basically your blog page uses the template home.php which is your default template I guess.

    esmi

    (@esmi)

    Close. ?? ‘home is a reserved file name from way back when and, on some servers, home.php will be loaded in preference to index.php (the default posts page in a theme). By naming your custom page template home.php, you introduced an element of confusion into what is normally a simple rule: your main posts page always uses the index.php template file in a theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Want to edit posts page template when I have a static homepage’ is closed to new replies.