The MU forums have moved to WordPress.org

how to apply a custom template to page2 (5 posts)

  1. anointed
    Member
    Posted 14 years ago #

    Scenario:
    On my blog homepage I make a call to the loop at the bottom of the page. The user sees 5 articles, and below that they can click on 'older articles' to see prior articles.

    url would be like mysite.com/page/2/

    How do I apply a different template to the 2,3,4 etc.. pages?

    I really need to change it as I have sliders and galleries among other things on my index page. There is absolutely no reason to be showing that information on 'older articles'...

    I have my own page.php and archive.php files in my theme, but obviously they are not called in the wp architecture for 'more' pages.

    What do I need to name a custom template to work in this area? (index-page*.php) etc.

  2. anointed
    Member
    Posted 14 years ago #

    And no, I do not have the option of assigning a 'custom homepage' template instead of the index, as I am going to use that page as a splash intro for the site.

    I can't imagine that wp has not thought about templating 'older articles' loops from the index file.

  3. DeannaS
    Member
    Posted 14 years ago #

    Take a look at the template heirarchy information:
    http://codex.wordpress.org/Template_Hierarchy

    Make all your mods to home.php instead of index.php. Home.php will by your "home page" and index.php will handle all the rest of the loops.

  4. anointed
    Member
    Posted 14 years ago #

    I am already using home.php for a splash intro page otherwise your idea would work perfectly.

    From what I can see in the Hierarchy it looks like wp does not have an 'index2.php' or any type of architecture beyond home/index/category/single

    Is there a way to 'hack' in another step to the hierarchy of wp?

  5. DeannaS
    Member
    Posted 14 years ago #

    Okay, I misunderstood. What you want to do is apply a custom template to just the "special" page - "page 2." So, you make a special template in your theme like it says to do here:
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Then, for your page 2, apply the special template, and let all the other pages run through the normal index.php.

About this Topic

  • Started 14 years ago by anointed
  • Latest reply from DeannaS