List all categories outside loop

<h3>Categories</h3>
    <ul>
      <?php
      $args = array(
         'orderby' => 'slug',
         'parent' => 0
      );
      $categories = get_categories( $args );
      foreach ( $categories as $category ) {
         echo '<li><a href="' . get_category_link( $category->term_id ) . '" rel="bookmark">' . $category->name . '' . '' . $category->description . '</a></li>';
      }
     ?>
    </ul>

Resources: http://petragregorova.com/articles/customize-wp-categories-output/

Leave a Reply

Your email address will not be published. Required fields are marked *