WordPress.org

Ready to get started?Download WordPress

Forums

Category / Subcategory structure (7 posts)

  1. andrew_h
    Member
    Posted 9 years ago #

    I may be on the wrong track here, so apologies if I am.
    I find myself wanting to do things with categories and subcategories that do not at my level of knowledge (which includes a working knowledge of php) seem easy to achieve. Simple things really like be able to make my category and subcategory menu list present itself in the order I desire and to be able to change the order at whim. Or to print out a catgeory listed archive sort in the order I want with subcategories appearing in the right position relative to categories. I am sure with a bit of messing with conditional statements I can achieve this but perhaps it could be easier in the default structure. One of the main controlling issues for sort order seems to be the category ID#. I tried messing with this yesterday directly in the data-base but it is not so easy because the posts hold the reference to the category # so if you change the category# the post does not know where to go (as far as I could see).
    So, this is a request that something along the lines of easily editable category ID #'s and perhaps a separate subcategory ID, and default sorts to be by category / subcategory ID rather than by this sometimes and alphabetical other times be considered for the future. Or any other structure that achieves the same.
    Or, if I am way off and this is already easily possible, just point me in the right direction, I do not mind doing some work.
    Andrew

  2. unoamigo
    Member
    Posted 9 years ago #

    Well, changing the cat_id's in general is probably a bad idea. Be too easy to end out with estranged posts.
    Adding another field for sort order would make it possible.
    For now though, you can manually create the category list on your index.php page - this will allow you to have any order you want.
    Not a perfect system, but it's getting closer. ;-)

  3. Jinsan
    Member
    Posted 9 years ago #

    you can add spaces infront of the category you want last. So say you have:
    Music
    Video
    And you want Video to be above Music, you would add a space to the start of Music, and that will enable Video to be on top. WP doesn't show the spaces, so it just looks ordered.
    Hope that makes sense

  4. andrew_h
    Member
    Posted 9 years ago #

    lol these are helpful suggestions, even solutions, but long term it would be nice to do something as bit more structured wouldn't it? Another field for sort order sounds a good idea.
    Andrew

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    Andrew,
    You can change the sort order in various ways using the wp_list_cats() function.
    wp_list_cats("sort_order=asc&sort_column=name") should do the trick.
    But if it doesn't, you can tinker with the various options at http://wiki.wordpress.org/wp_list_cats.

  6. unoamigo
    Member
    Posted 9 years ago #

    Andrew,
    Yes, something more structured would be nice. I'm sure it will happen eventually, I'm not much for begging. We are getting a great deal on some truly wonderful software. Makes me more than happy to monkey around a bit to get what I want.

  7. andrew_h
    Member
    Posted 9 years ago #

    agree totally unoamigo :-)
    Andrew

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.