finding out an archives category? (2 posts)

  1. syrupcore
    Posted 10 years ago #

    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?


  2. oriecat
    Posted 10 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.