WordPress.org

Forums

wp_list_cats bug (11 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    After upgrading I wasn't able to set a file variable in wp_list_cats()
    I walked throug the code and changed this:

    function get_category_link($echo = false, $category_id, $category_nicename, $file = "") {
    global $wpdb, $tablecategories, $post, $querystring_start, $querystring_equal, $cache_categories;
    $cat_ID = $category_id;
    $permalink_structure = get_settings('permalink_structure');
    if ('' == $permalink_structure) {
    if($file == ""){
    $file = get_settings('home') . '/' . get_settings('blogfilename');
    }else{
    $file = get_settings('home') . '/' . $file;
    }

  2. cromano
    Member
    Posted 10 years ago #

    Where do I paste this code to make it work?

  3. Kafkaesqui

    Posted 10 years ago #

    function get_category_link

    wp-includes/template-functions-category.php

  4. aprilgem
    Member
    Posted 10 years ago #

    I tried this fix, but I'm still not able to set a file variable in wp_list_cats. It uses index.php and not the archive.php I set it to use. Am I missing something?

  5. MatthiasHeil
    Member
    Posted 10 years ago #

    I guess I'm having the same problem: My parent categories are not displayed although they used to be, and although I've tried the Wiki options for wp_list_cats... any remedy for that?

    <?php wp_list_cats('hierarchical=1&optionall=1&sort_column=name&optioncount=1'); ?>
    in my theme's index.php just produces an unsorted list without parent names and links...

    Another silly question: how can I reduce the space between my link group headings and the link group? - Thanks ever so much!

    http://www.matthiasheil.de/wordpress/

  6. cromano
    Member
    Posted 10 years ago #

    thanks Kafkaesqui

    I tried, but it doesnt work. Any guess?

  7. cromano
    Member
    Posted 10 years ago #

    Don't know what I did, but sudenly it works. Thanks all

  8. kwbisch
    Member
    Posted 10 years ago #

    I'm using <?php wp_list_cats('sort_column=name&optioncount=1&children=0'); ?>

    and all it's producing is an unsorted list... Any thoughts? I hate the fact that we sort categories by ID# by default, how dumb is that?

  9. Kafkaesqui

    Posted 10 years ago #

    "I hate the fact that we sort categories by ID# by default, how dumb is that?"

    Since that's exactly how I want to sort them, it's not dumb to me.

    Anyway, if you're using 1.5:
    http://wordpress.org/support/topic.php?id=11766#post-138417

  10. jkeyes
    Member
    Posted 10 years ago #

    to get an ordered list you need to use the following:
    <?php wp_list_cats('sort_column=name&hide_empty=0'); ?>

    previously the hide_empty arg wasn't necessary.

  11. kwbisch
    Member
    Posted 10 years ago #

    Amazing how many people told me that I need to use 'sort_column=name'.... Amazing also how many people didn't read the rest of the entry saying those of us with this problem were already using that. Duh.

    Kafkaesqui - Thanks for the file fix.... I still don't understand why WordPress sorts by ID# by default, I would think *most* bloggers would want to sort by name, or number of entries or something other than ID#.... which is why I said I thought that was dumb.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.