• Hi, I know I can access my categories archive by going to https://www.site.com/category/category_name and my global category using https://www.site.com/year/month, but is there any way to merge the urls to display a year/month archive from only one category?

    My idea is to create an archive based of categories. Like:

    Category X
    Posts from 2008: Jan (link to the archive), Feb (link), …

    Category Y
    Posts from 2007: Jan (link to the archive), Feb (link), …

    and so on. Is there any way to acomplish this without specific wordpress code? If not, could anybody paste some code that would allow me to do that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I think you should be able to insert this code.

    // Get the last 10 posts in the special_cat category.
    <?php query_posts(‘category_name=special_cat&showposts=10’); ?>

    <?php while (have_posts()) : the_post(); ?>
    <!– Do special_cat stuff… –>
    <?php endwhile;?>

    Thread Starter tiosolid

    (@tiosolid)

    Thanks, but I still cant “filter” the posts by date ;/

    Is there any way to pass dates to the showposts parameter?

    You can add this ??

    orderby=date

    // Get the last 10 posts in the special_cat category.
    <?php query_posts(‘category_name=special_cat&showposts=10&orderby=date’); ?>

    <?php while (have_posts()) : the_post(); ?>
    <!– Do special_cat stuff… –>
    <?php endwhile;?>

    Thread Starter tiosolid

    (@tiosolid)

    Thanks! The query_posts() function is exactly what i Need, just need to call it this way:
    query_posts(‘cat=3&year=2004’);

    This is exactly what I need, but I would like to limit my archive from the archive widget to one category. Can I use this code to help?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Create an archive by category sorted by date’ is closed to new replies.