WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] not all categories appear in the "edit a post" page (2 posts)

  1. pietrosperoni
    Member
    Posted 8 years ago #

    Hello, I am using wordpress 2.0.1 I mainly upgraded from 1.5 to use categories as tags, which is what I am doing. Each post is in sometimes about 10 categories, and I have all together more than 300 categories and growing. It is ok for me, as it makes the info easily available, and so on; in delicious I have more than a 1000 tags.

    Problem: while all categories do show up in the Manage>Categories page, only some (the old ones) show up in the Edit Post page and in the write post page. There is probably some threashold somwhere, where is it and how can I change that?

    When I edit an entry, not only I cannot see all the categories it is inside, but if I save it again, all the categories that are not present in the page get deleted.
    Temporarily (since I was using the technorati plugin) I keep for each post a "technorati" custom field with the whole list of all the tags associated with that entry. SO if I need to edit an entry I just relist the whole set of tags(i.e. categories) in the "add category" field. This seem to work, but is very annoying.

    So, if it is a bug, is there a fix for it? Where?
    If it is a feature, how can I disable it?

    Many, many thanks,
    Pietro

    P.S. the reason why I don't use the technorati plugin for tags is because it does not release rss of each tag page, and for the use that I have of the blog it is absolutely essential.

    P.P.S. the same thing happened in wp 2.0

  2. pietrosperoni
    Member
    Posted 8 years ago #

    Solved, this is what I did:
    I took all the categories that would appear. and cross checked with the ones in the DB. The first reason why a category would not appear was that some categories had no parents. Mea Culpa that have I messed with the DB before. So i changed their parent value in the DB setting it to 0.
    Those categories would apper, but still not all categories would appear. I played around with the code and found the following line:

    function return_categories_list($parent = 0) {
    global $wpdb;
    return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC LIMIT 100");
    }

    Of course if people see categories as hierarchical objects, you rarely will have 100 ofspring. But if, like me, you see them as tags then you can easily have more than 100 tags.
    So I changed the line into:

    function return_categories_list($parent = 0) {
    global $wpdb;
    return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC LIMIT 10000");
    }

    and now it works fine.

    Pietro

Topic Closed

This topic has been closed to new replies.

About this Topic