Support » Fixing WordPress » Show cat description in Archive

  • Im trying to get the dewscription showing in archives.php
    I have tried a couple of things and read in the forum but cant seem to get it right.

    I would like to show it as follows:

    <?php if (have_posts()) : ?>

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h1>Articles in ‘<?php echo single_cat_title(); ?>'</h1>
    [CAT_DESCRIPTION CODE HERE]

    Anyone?
    If there is a post resolving this, I missed it, so let me know.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anybody?

    The following works for me:

    <?php if (have_posts()) : ?>
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h1>Articles in '<?php echo single_cat_title(); ?>'</h1>
    <?php /* below is what you are looking for */ ?>
    <p><?php echo category_description(single_cat_title()); ?></p>

    i’m trying to do the same thing. the code above, dm, actually just displays the single_cat_title again for me. instead, i want the category description below the cat title. any thoughts?

    I got rid of the double title by changing DMC’s last line above to read:
    <p><?php echo category_description(); ?></p>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show cat description in Archive’ is closed to new replies.