Need category header to link to category archive list

I tried using wp_list_categories, but that just gives me a list of the categories. I currently have this code in my category-recipes.php file:

<ul class="subcats-list">
            <h2 class="subcats-title"><?php echo get_cat_name(38); ?></h2>
                <?php
                $recipes = new WP_Query();
                $recipes->query('showposts=5&orderby=rand&cat=38&post_type=recipe');

                while ($recipes->have_posts()) : $recipes->the_post(); ?>
                    <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
                <?php endwhile; ?>

        </ul><!-- subcat -->

I was thinking about putting a link tag before the get_cat_name but I am not sure what to include in it.

Related posts

Leave a Reply

1 comment

  1. Use get_category_link. Your code (relevant part) will look like:

    <h2 class="subcats-title">
        <a href="<?php echo get_category_link(38); ?>">
            <?php echo get_cat_name(38); ?>
        </a>
    </h2>