Categories no longer in order wp1.5 (12 posts)

  1. lokrin
    Posted 11 years ago #

    My categories now appear to be in the order created (category id) rather than by subcategory, etc. Any idea about a fix for this?


  2. JoeyDay
    Posted 11 years ago #

    I seem to be experiencing the same problem. Just installed 1.5.

    No matter how I set the options in the wp_list_cats template tag, my category list is ordered by ID and is not hierarchical. What's going on here?


  3. mumkin
    Posted 11 years ago #

    likewise. i upgraded from 1.21 to 1.5 last night, and using the freshly-installed, untouched "classic" theme, as well as a slightly-modified "default" (kubrick), my categories refuse to get hierarchical though it ought to be enabled by default.

    other arguments are respected -- I didn't exhaust them all, but it definitely respects optiondates and seems to disregard sort_column and hierarchical :(


  4. cavemonkey50
    Posted 11 years ago #

    It's been acknowledged here: http://wordpress.org/support/topic.php?id=23902. I have also filed a bug report: http://mosquito.wordpress.org/view.php?id=908.

    Hopefully someone from the WordPress team will get on this and fix it soon.

  5. lokrin
    Posted 11 years ago #

    Don't ask why this works, but it does. I just punch in numbers and see what happens... =P

    File: /wp-includes/template-functions-category.php

    and look for the following section:

    // out of the WordPress loop
    function wp_list_cats($args = '') {
    parse_str($args, $r);
    if (!isset($r['optionall'])) $r['optionall'] = 0;
    if (!isset($r['all'])) $r['all'] = 'All';
    if (!isset($r['sort_column'])) $r['sort_column'] = 'ID';
    if (!isset($r['sort_order'])) $r['sort_order'] = 'asc';
    if (!isset($r['file'])) $r['file'] = '';
    if (!isset($r['list'])) $r['list'] = true;
    if (!isset($r['optiondates'])) $r['optiondates'] = 0;
    if (!isset($r['optioncount'])) $r['optioncount'] = 0;
    if (!isset($r['hide_empty'])) $r['hide_empty'] = 0;
    if (!isset($r['use_desc_for_title'])) $r['use_desc_for_title'] = 0;
    if (!isset($r['children'])) $r['children'] = true;
    if (!isset($r['child_of'])) $r['child_of'] = 0;
    if (!isset($r['categories'])) $r['categories'] = 0;
    if (!isset($r['recurse'])) $r['recurse'] = 0;
    if (!isset($r['feed'])) $r['feed'] = '';
    if (!isset($r['feed_image'])) $r['feed_image'] = '';
    if (!isset($r['exclude'])) $r['exclude'] = '';
    if (!isset($r['hierarchical'])) $r['hierarchical'] = true;

    list_cats($r['optionall'], $r['all'], $r['sort_column'], $r['sort_order'], $r['file'], $r['list'], $r['optiondates'], $r['optioncount'], $r['hide_empty'], $r['use_desc_for_title'], $r['children'], $r['child_of'], $r['categories'], $r['recurse'], $r['feed'], $r['feed_image'], $r['exclude'], $r['hierarchical']);

    See the line with HIDE_EMPTY? Change it to a zero [0] and then save.

    It worked for me. Supposedly hide_empty is supposed to hide empty categories....

  6. lokrin
    Posted 11 years ago #

    Oh yeah - forgot, in the theme files look for the line

    <?php wp_list_cats(' ... '); ?>

    whatever is there like list=0 or something else, just add &children=1 so that it looks like

    <?php wp_list_cats('list=0&children=1'); ?>

  7. woddfellow2
    Posted 11 years ago #

    You just change "<?php wp_list_cats(0, "", "name", "asc", "", 1, 0, 1, 1, 1, 1, 0,"","","","","") ?>" to "<?php wp_list_cats('optioncount=1'); ?>".

  8. JoeyDay
    Posted 11 years ago #

    No, it's not that easy. Believe me, I've tried every set of options I can think of. The guys above are right. It is respecting several of the settings, but it seems that "sort_column" defaults to ID and "hierarchical" defaults to 0 no matter how you set them yourself.

    I'm sure the WordPress folks wouldn't have released 1.5 if this problem were effecting everyone. It probably works great on a fresh install, and it might even work for most of those who upgraded.

    Did you upgrade from 1.2.x, wodd?

  9. woddfellow2
    Posted 11 years ago #

    Yes, I upgraded from 1.2.2. You should try ripping the category code from the WordPress Classic theme's sidebar.

  10. Ryan Boren
    WordPress Dev
    Posted 11 years ago #

  11. lquilter
    Posted 11 years ago #

    The solution posted here didn't work for me, but the one posted here


    worked for me.

  12. moshu
    Posted 11 years ago #

    You could also upgrade to 1.5.1 - and this will be solved.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.