The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Creating a different template for page 2 of the front page (2 posts)

  1. c.bavota
    Posted 7 years ago #

    I was wondering if it is at all possible to create a different template for subpages of the front page.

    I have a site that has a certain layout for the front page. But if a user clicks to see previous posts, I want that page to have a different layout.

    The way WordPress is set up it uses the index.php for the front page and all of its subpages. I can't seem to figure out if there is already a function for this or not.

  2. MichaelH
    Posted 7 years ago #

    Guess you could use something like:

    if ( get_query_var('paged')>='2' ) {
    get_header('myheader2'); //will include header-myheader2.php
    get_footer('myfooter2'); //will include footer-myfooter2.php
    get_sidebar('mysidebar2'); //will include sidebar-mysidebar2.php

Topic Closed

This topic has been closed to new replies.

About this Topic