WordPress.org

Support

Support » Installation » Categories no longer in order wp1.5

Categories no longer in order wp1.5

Viewing 11 replies - 1 through 11 (of 11 total)
  • 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?

    http://www.joeyday.com

    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 🙁

    http://www.slakethirst.com

    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.

    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….

    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'); ?>

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

    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?

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

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

    http://www.kahsoon.com/2005/05/10/wordpress-hierarchical-category-indent/

    worked for me.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Categories no longer in order wp1.5’ is closed to new replies.