WordPress.org

Ready to get started?Download WordPress

Forums

archives for just a category (6 posts)

  1. jayoh
    Member
    Posted 7 years ago #

    hello everyone, first time using these boards.

    i've got a seemingly easy question, but i've been unable to find a proper solution or answer anywhere.

    i've got a couple categories, and i need to list {by month} the archives for that particular category {and no others}.

    when using wp_get_archives it mashes all the categories into one - basically i need to pass a category variable to it - but i'm not aware of how to do so.

    thanks in advance!

  2. jayoh
    Member
    Posted 7 years ago #

    this really isn't that difficult, is it?

  3. Dalton
    Member
    Posted 7 years ago #

    I *think* that you could use query_posts before the loop in your archive template to limit your query to just the category you want.

    This is entirely theoretical, of course. I don't actually know anything about anything.

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

  4. jayoh
    Member
    Posted 7 years ago #

    thank you dalton.

    i'm currently using query posts to show the archive links for the correct category, but those links mash up all the sites content, and doesn't keep it seperate.

    i tried adding

    query_posts('cat=2');
    wp_get_archives('type=monthly&limit=12');

    but it didn't change a thing.

    will i need a plugin for this? =/

  5. Dalton
    Member
    Posted 7 years ago #

    Sorry, I thought you were trying to show all the posts in the category, not just link to them. I think query_posts is just for the loop.

    Maybe there's some useful information here:
    http://wordpress.org/support/topic/69776

    But yes, it looks like you'll need to do a little coding.

  6. jayoh
    Member
    Posted 7 years ago #

    thanks again, dalton.

Topic Closed

This topic has been closed to new replies.

About this Topic