Support » Fixing WordPress » How display category description without having to hard code

  • I want to display the category description for each category, and have it listed beneath the category on the sidebar. So far the only thing I can figure out so far is that is a way to do it that required hard coding the list. So I cannot add new cats on the fly w/o having to re-code the cat list.

    This is what I’m doing now and it is a pain! Anyone have any suggestions about displaying the list and cat description:

      <b><?php wp_list_cats(‘exclude=2,3,4,5,6,7,8,9,10’); ?></b>

    • <?php echo category_description(1); ?>
    • <b><?php wp_list_cats(‘exclude=1,2,4,5,6,7,8,9,10’); ?></b>

    • <?php echo category_description(3); ?>
    • <!–

    • <b><?php wp_list_cats(‘exclude=1,3,4,5,6,7,8,9,10’); ?>
      </b><?php echo category_description(2); ?>
    • –>

      <b><?php wp_list_cats(‘exclude=1,2,3,5,6,7,8,9,10’); ?></b>

    • <?php echo category_description(4); ?>
    • <b><?php wp_list_cats(‘exclude=1,2,3,4,6,7,8,9,10’); ?></b>

    • <?php echo category_description(5); ?>
    • <b><?php wp_list_cats(‘exclude=1,2,3,4,5,7,8,9,10’); ?></b>

    • <?php echo category_description(6); ?>
    • <b><?php wp_list_cats(‘exclude=1,2,3,4,5,6,8,9,10’); ?></b>

    • <?php echo category_description(7); ?>
    • <b><?php wp_list_cats(‘exclude=1,2,3,4,5,6,7,9,10’); ?></b>

  • The topic ‘How display category description without having to hard code’ is closed to new replies.