WordPress.org

Forums

[resolved] 2.0.5 Archives and Page Templates (6 posts)

  1. zarathos
    Member
    Posted 8 years ago #

    I'm setting up a new theme for my blog, and I wanted to incorporate an archives page. For the sake of simplicity, I'm using the archive.php file from Kubrik (with a few modifications to styles for my theme).

    I read a few articles on the codex and forums about setting up a WP Page and using the archive.php file for the Page's template, but they all make reference to a Template dropdown that should be on the Write Page interface that isn't there.

    I'm using a fresh install of WP 2.0.5, with no plugins installed. I have a page.php along with the archive.php in my theme. Could some kind soul point me in the right direction to fix this issue?

  2. Ryan Fitzer
    Member
    Posted 8 years ago #

    Your saying there is no sidebar box on the right of the post editor in the Write>Page screen called "Page Template"?

  3. MichaelH
    Member
    Posted 8 years ago #

    Consider the possibility that no file in your theme's template files has this at the beginning of the file:


    <?php
    /*
    Template Name: template_name_here
    */
    ?>

  4. Ryan Fitzer
    Member
    Posted 8 years ago #

    Well, then you would need to put that in there for the function of choosing a template to work.

  5. badjeros
    Member
    Posted 8 years ago #

    I think I had and solved the same problem.

    If you are like me, you copied 'archive.php' from the default kubrick theme into your new theme, but not also 'archives.php'.

    Once 'archives.php' is copied over, the 'write pages' screen will recognize that there is an available template and add a 'Page Template' box to the sidebar which you can then use as per the codex instructions.

    FYI, 'archive.php' is a template for generating pages of old entries once they have been called by the user. 'archives.php' is a template for creating a list of available pages of old entries.

    So if you follow the codex instructions, you use the Create Page page to create an archive page using the 'archive.php' template which will be a list of available monthly pages which will individually be generated from 'archives.php'. Confused? I am.

  6. Kafkaesqui

    Posted 8 years ago #

    "If you are like me, you copied 'archive.php' from the default kubrick theme into your new theme, but not also 'archives.php'."

    ????

    archive.php = Date-based archives template.
    archives.php = Page template designed to display archive links.

    In a little more detail:

    archive.php is the 'built-in' template for displaying posts in your archives when queried by date (similar to category.php or category queries and search.php for search results).

    archives.php is a Page template that comes with the default theme.

    If all you want is the Page template, then all you need to copy over is archives.php.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags