WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Problems creating archive page with WP 2.2 (7 posts)

  1. lineageescape
    Member
    Posted 6 years ago #

    Hey guys (and gals)!

    I'm building a theme from scratch and I am having troubles on getting the archive index to work.

    I created an archive.php and wrote and styled it. I could see it when clicking on a category because I didn't create any category.php or date.php as of yet.

    I want to link to it, but I don't find the link. So I decided to "create and archive index" as it is written in the Codex (here: http://codex.wordpress.org/Creating_an_Archive_Index). Since I don't have any pages template box I used the Custom Fields.

    However, _wp_page_template is not present in the dropdown menu.

    What should I do?

  2. moshu
    Member
    Posted 6 years ago #

    1. I want to link to it, but I don't find the link.
    You never link directly to any of the template files. Never.

    2. In order to have the Page Template option to show up you need at least two [2] Page templates: the default page.php and one that you created.

  3. lineageescape
    Member
    Posted 6 years ago #

    Hey,

    Thanks for the quick answer. I just checked, and in my theme folder I have:

    index.php
    single.php
    page.php
    archive.php

    So that should do it. No?

  4. moshu
    Member
    Posted 6 years ago #

    No. Of course, not.
    Study the default theme.
    archive.php is NOT a Page template.
    archives.php (plural S at the end!) is a Page template!
    Alse:
    Template_Hierarchy
    Pages (see the templates section)

  5. lineageescape
    Member
    Posted 6 years ago #

    Well,

    I created an archives.php page (pretty similar to archive.php) and... nothing. The option is still not showing up.

    Is that normal?

    I will read more into the links you gave me, thanks.

  6. moshu
    Member
    Posted 6 years ago #

    (pretty similar to archive.php)
    That's the problem.
    You do things BEFORE reading the offered resources. Don't post back until you finish reading everything that was suggested.

  7. lineageescape
    Member
    Posted 6 years ago #

    I read the links you suggested, and had nothing to change, besides:

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

    that I had done before.

    I solved my problem by switching to another theme and then getting back to my theme, which worked.

    Anyway, Thanks for the help.

Topic Closed

This topic has been closed to new replies.

About this Topic