WordPress.org

Ready to get started?Download WordPress

Forums

Please help on how to use archives.php file. (6 posts)

  1. mehtainc
    Member
    Posted 7 years ago #

    Hello,

    I really need help as early as possible. I would like to generate archives in my web application but I do not have idea how to use archives.php in my project.

    I have tried to find out how to create archives in wordpress and I have done it also but I do not know how to integrate this file in my application.

    If you want to know what I want then please visit the below mentioned URL
    http://techcrunch.com/archives/

    I am getting fatal error when I have been uploaded the archives.php in my theme and when I run the program.

    Please please please help me to solve this problem.

    Thank you so much.

  2. moshu
    Member
    Posted 7 years ago #

    You should define what do you mean by "generating archives". WP does archive every post of yours in the moment you publish it.
    You just have to find the ways to display your archved posts in the way you want.
    archive.php is a Page template > http://codex.wordpress.org/Pages
    As with any Page Template - you create a new Page by using that template. (In this case you don't need to put anything in the content!)

    As for the site you linked to. Do this in the future:
    - take the URI, e.g. example.com - and type after it in the address bar > "wp-content/plugins"
    example.com/wp-content/plugins
    If you are lucky, you'll see all the plugins on that site.
    In this case one called "smartarchives.php".
    Then you come back here and use the search box on top right.
    Other good keywords (=plugins) to search:
    clean archives
    clean archives reloaded

  3. moshu
    Member
    Posted 7 years ago #

    Oh, and next time don't triple post the same question because you may end up with all your posts deleted!

  4. mehtainc
    Member
    Posted 7 years ago #

    Hello Moshu,

    I an new to wordpress so I do not know what to do. But the below mentioned is the problem I am facing, please check it and please reply me what to do.

    When I am placing archives.php in my theme folder and when I rename it to index.php, it works fine

    http://www.mehtainc.com/wordpress/

    but if I do not change the file and it I will try to acces the file at below given path then it gives me an error.
    http://www.mehtainc.com/wordpress/wp-content/themes/tech/archives.php
    ERROR IS : fatal error : Call to undefined function: wp_get_archives()

    please tell me what to do know ?

  5. KatGirl
    Member
    Posted 7 years ago #

    Did you name your archives.php template before uploading?

    ie:
    <?php
    /*
    Template Name: Archives
    */
    ?>

  6. moshu
    Member
    Posted 7 years ago #

    1. Rule number One. You never, ever access a template file directly. Never. WordPress will decide which template file to use. WP knows better than you :)
    2. You don't read, you just post. I wrote above:
    archive.php is a Page template > http://codex.wordpress.org/Pages
    As with any Page Template - you create a new Page by using that template. (In this case you don't need to put anything in the content!)

    - Creating a new Page means: admin > Write > Write Page and on the right select this Template.

Topic Closed

This topic has been closed to new replies.

About this Topic