• I’d like to display sub categories and their description. So far I have been using the code below:

    <?php
    $categories = get_categories("title_li=&orderby=id&hide_empty=0&child_of=1");
    foreach ((array) $categories as $cat) {
    ?>
    <h2><a href="<?php echo get_category_link($cat->cat_ID); ?>" title="View all posts in <?php echo $cat->cat_name; ?>"><?echo $cat->cat_name; ?></a></h2>
    <p><?php echo $cat->category_description; ?></p>
    <?php } // end foreach loop ?>

    I recently installed the My Category Order plugin and in their documentation it asks you to use:

    wp_list_categories('orderby=order&optioncount=1&hierarchical=0&title_li=<h2>Categories</h2>');

    I’d love some help to integrate the code above with the plugin call.

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What if you change:

    orderby=id

    to

    orderby=order

    Appears this is what’s specific to the plugin.

    Thread Starter graeme-mac

    (@graeme-mac)

    Hmm – Changing the parameter did not order the list. I also tried changing:

    $categories = get_categories("title_li=&orderby=id&hide_empty=0&child_of=1");

    TO:

    $categories = wp_list_categories("title_li=&orderby=order&hide_empty=0&child_of=1");

    But that didn’t help either.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customize sub cat order & display description’ is closed to new replies.