WordPress.org

Ready to get started?Download WordPress

Forums

How to show Archives by week not month (6 posts)

  1. lotsagarlic
    Member
    Posted 8 years ago #

    I'm sure this is documented somewhere, but I can't seem to find it. I have a new blog with only one link under "Archives" -- the month of "March":

    http://www.fraudbusterbob.com/blog/

    Eventually, of course, the blog will show additional links for each month that the blog is up, but in the meantime, is there a way to list the archives by week? One archive link all by itself looks kinda L O N E L Y ...

    Thanks --

  2. lotsagarlic
    Member
    Posted 8 years ago #

    A related question -- what determines how many posts are on the index page and when they scroll off to an archive page?

    For instance, if the authors for my blog wrote a total of two dozen posts in one day, they wouldn't all be on the home page, would they? That would be a long page.

  3. Aleister
    Member
    Posted 8 years ago #

    wp_get_archives('type=weekly');

    That should do it :)

  4. Aleister
    Member
    Posted 8 years ago #

    In WordPress 2.x:

    - go to your admin panel
    - click the 'Options' tab
    - click the 'Reading' sub-tab
    - change the value for "Show at most X posts"

    That value will determine how many posts are shown on the index page.

  5. lotsagarlic
    Member
    Posted 8 years ago #

    Thanks very much, Aleister, for the helpful information. (I'm always happier knowing where and how to tweak.)

    I found the syntax and changed it. For other users who may be curious about the same issue, here are my findings:

    I changed syntax to
    wp_get_archives('type=weekly');

    in three of the theme files (theme adapted from Wuhan):
    archives.php
    header.php
    sidebar.php

    But the result is not ideal. The date format in the sidebar is now too verbose to fit in the sidebar:

    March 27, 2006–April 3, 2006
    March 13, 2006–March 19, 2006
    March 6, 2006–March 12, 2006

    Doubtless I could change that, but I also see that the archive page title for any given week nows reads a generic “Archive for 2006”.

    I also wonder what would happen to permalinks, which are famously finicky. So plain ole monthly listings for archives is best for me, I think.

  6. Aleister
    Member
    Posted 8 years ago #

    Here is the info on wp_get_archives btw:

    http://codex.wordpress.org/Template_Tags/wp_get_archives

Topic Closed

This topic has been closed to new replies.

About this Topic