WordPress.org

Ready to get started?Download WordPress

Ideas

Category argument for wp_get_archives()

  1. BenRacicot
    Member

    Hello,

    I've been tracking an issue with category based archives by month, day or year.

    wp_get_archives() allows:
    <?php $args = array(
    'type' => 'monthly',
    'limit' => '',
    'format' => 'html',
    'before' => '',
    'after' => '',
    'show_post_count' => false,
    'echo' => 1,
    'order' => 'DESC'
    ); ?>

    It seems as though there should be a 'cat => $id' argument to avoid issues that the community has constantly asked for. ei see stackoverflow, http://bit.ly/1eN59nX etc... there are also unkept plugins which use rewrite rules to get the desired month+category based archives.

    Perhaps this argument could first look to the existing archive hierarchy:

    category-{slug}.php
    category-{id}.php
    category.php
    archive.php
    index.php

    This hierarchy seems to be "stubbed" out for this category functionality missing from the existing archive functions.

    If there's anything I can do to help this please give me a hoot. @BenRacicot

    Posted: 9 months ago #
  2. AndyWarren
    Member

    I ran into an issue needing yearly archives of specific catergories recently. There really just wasn't much available, so I wrote my first plugin to accomplish this. It may help you, but it currently only does years and not months. Month's is in the works, just taking me a while to get it squared away. You can find the plugin here: http://wordpress.org/plugins/aw-yearly-category-archives/

    Posted: 9 months ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    1 Vote
  • Status

    This idea is under consideration