WordPress.org

Ready to get started?Download WordPress

Forums

Format category-list (2 posts)

  1. kelloggz
    Member
    Posted 8 years ago #

    Hi,
    i want to build a category-list which i can format for myself (wp_list_cats can't do that), i tried the following:


    <?php foreach (get_the_category() as $cat) { ?>
    <ul class="categorytitle_<?php echo $cat->cat_ID; ?>">
    <li>
    <a href="<?php echo get_category_link($cat->cat_ID);?>">
    <?php echo $cat->category_nicename; ?>
    </a>
    </li>
    <?php } ?>

    But get_the_category() gets only the category for the post. I don't find any solution, because no function returns the categories so i can build the list with the cat_ID.

    Any Ideas welcome.

    Thanks

  2. kalico
    Member
    Posted 8 years ago #

    I am not sure I understand exactly what you are trying to do in terms of formatting, but I just found a great plugin for managing the order of your category list. It gives total control of the order, then you can use CSS to format the appearance. http://geekyweekly.com/mycategoryorder/
    Hope it helps you -- or someone else.

Topic Closed

This topic has been closed to new replies.

About this Topic