WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding Category Description (2 posts)

  1. JohnMag4u
    Member
    Posted 8 years ago #

    How can I add the category description by placing code before the loop sequence in the index.php file?

  2. thommeredith
    Member
    Posted 7 years ago #

    I figured out that I can place this on the main category page and it will show the category title and then the description,

    
    ...
    
    <?php if (have_posts()) : ?>
    
    <?php $this_category = get_category($cat);?>
    
    <dt><?php echo $this_category->cat_name; ?></dt>
    <dl><?php echo $this_category->category_description; ?></dl>
    
    <?php while (have_posts()) : the_post(); ?> 
    
    ...
    

    Here is also a link for more information:
    http://codex.wordpress.org/Category_Templates#The_Custom_Category_Template

Topic Closed

This topic has been closed to new replies.

About this Topic