Support » Fixing WordPress » finding out an archives category?

  • Hi. I’d like to list a link of available posts on the top of each archive page. I’m trying to do it with list_cats but I can’t figure out how to pass the list_cats(arguments) a variable with the current category ID. Here’s what I have so far from the CODEX:

    $cat = get_the_category(); $cat = $cat[0];

    and then
    $posts = get_posts('numberposts=9&offset=1&category=$cat');
    foreach($posts as $post) :
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>

    just getting errors – cause I’m just hacking around, not really understanding the first section. Can anyone help me?


Viewing 1 replies (of 1 total)
  • I don’t understand what you are wanting. An archive page is a list of available posts by category or date, etc, so I don’t get what you are trying to put at the top, unless you are considering something else as your archive page. Maybe you could explain more?

Viewing 1 replies (of 1 total)
  • The topic ‘finding out an archives category?’ is closed to new replies.