WordPress.org

Ready to get started?Download WordPress

Forums

Category based archives (yearly)? (2 posts)

  1. Agent D
    Member
    Posted 4 years ago #

    Hi,

    I'm trying to creat archive page for a specific category. I got it to work in yearly archive so far.

    <?php wp_get_archives('type=yearly'); ?>

    Now I need to find a way to only show the posts from category 9. If anyone can help me or give me a suggestion I really appreciate it. Thanks!!

  2. jessn
    Member
    Posted 4 years ago #

    Try this: (change the category name)

    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('showposts=10&category_name=music'.'&paged='.$paged);
    ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    
    ...all the stuff here
    
    <?php endwhile; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic