WordPress.org

Support

Support » How-To and Troubleshooting » Creating a different template for page 2 of the front page

Creating a different template for page 2 of the front page

  • c.bavota
    Member

    @tinkerpriest

    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.

Viewing 1 replies (of 1 total)
  • 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
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Creating a different template for page 2 of the front page’ is closed to new replies.