Forums

[Plugin: My Category Order] working in 2.7, but limitations? (13 posts)

  1. crcdesign
    Member
    Posted 11 months ago #

    I installed the my-category-order plug-in in a wp2.7 site as a widget and it works great. I don't want you to think I'm complaining about it, because it's definitely been a positive.

    What we really needed though was to use the child_of criteria for wp_list_categories(). It only took about 5 minutes to add that functionality to your base plug-in, but I'm curious why you left some of those criteria out. wp_list_categories() is pretty clearly documented and adding the extra doesn't seem to cause any issues.

    http://wordpress.org/extend/plugins/my-category-order/

  2. froman118
    Member
    Posted 11 months ago #

    crcdesign,

    The reason there are things missing from the widget is because they haven't been suggested yet. When I added the widget to the plugin 1.5 years ago I pretty much copied the built in Category widget exactly and slowly added options as people asked for them. I probably should just go through each of the parameters for wp_list_categories and make sure they are all available in the widget.

    I'll add the Child Of option to my todo list for the next release. I also need to add support for inserting more than one widget into the sidebar. So look for that sometime soon.

  3. samejohnton
    Member
    Posted 10 months ago #

    hello,

    I have installed your plugin and it works fine on the side bar due to the widget, and the order is as specified. However, this same order has not been applied to my categories on the top section (note under the web title etc). what should i do?

  4. froman118
    Member
    Posted 10 months ago #

    I'm assuming the top section is not a widget? If so then you'll have to modify your theme. If it is a widget then you might be stuck at the moment. My plugin only supports one widget at a time and I'm working on letting it support multiple widgets, but time is pretty scarce.

  5. samejohnton
    Member
    Posted 10 months ago #

    no its not a widget. am using the carrington theme and have no idea on php editing. can you advise me on how to edit the header and what codes to put, so as to apply the my categories order to the categories list on the header. My site is http://www.afrocap.org

  6. froman118
    Member
    Posted 10 months ago #

    In the header/header-default.php file find these lines near the end:

    <ul>
    <?php wp_list_categories('title_li='); ?>
    </ul>

    and change the middle line to this:

    <?php wp_list_categories('orderby=order&title_li='); ?>

  7. el Rafa
    Member
    Posted 10 months ago #

    crcdesign -

    Would you mind posting the code you used to modify the plugin to allow use of the child_of criteria?

    Thanks in advance!

  8. froman118
    Member
    Posted 10 months ago #

    el Rafa, if you do a search inside the plugin file for "wp_list_categories" you'll see the line where the widget puts together the template call. You can tack it on there just like you would in a sidebar template.

  9. el Rafa
    Member
    Posted 10 months ago #

    Thanks Andrew. (It *is* Andrew, right?) Unfortunately I'm somewhat new at tweaking WordPress, (not to mention not so fluent at writing PHP by hand) so I'd need some sample code to drop in. Maybe you could help? :)

  10. froman118
    Member
    Posted 10 months ago #

    On line 165:

    $cat_args = "orderby=order&order=ASC&show_count={$c}&hierarchical={$h}&hide_empty={$empty}&show_last_updated={&u}";

    Change it to this where X is the ID of the category you want to limit it to:

    $cat_args = "child_of=X&orderby=order&order=ASC&show_count={$c}&hierarchical={$h}&hide_empty={$empty}&show_last_updated={&u}";

    I'll try and do an update this weekend, so if you see an updated version of the plugin there will be a new option in the widget to specify this.

  11. zozo219
    Member
    Posted 9 months ago #

    Buy how I I order the parent categories ... or will that become obvious as I struggle to categorize my 417 catgories just imported from Blogger tags.

    Great plugin!

  12. froman118
    Member
    Posted 9 months ago #

    Eeeek 417 categories! I've never done an import from Blogger, but Wordpress also has tags along with Categories. A post's category should really be a broad grouping and then you use tags to add more detailed information.

    Someone might know a better way of doing the import, but if you want to keep your tags intact, you could run the SQL query on this page:

    http://wordpress.org/support/topic/180574?replies=3

    That will convert your categories to tags. Then you'd have to go through your posts and add them to the new categories you create.

  13. p0531d0n
    Member
    Posted 9 months ago #

    I have a custom cascaded CSS-based menu on my page and the <?php wp_list_categories('orderby=order&title_li='); ?> modification added ordering to it.
    Just wanted to let others know in case they run into the same problem.

    Thanks for this great plugin. Very useful!

    Thanks,

    Gabriel

Reply

You must log in to post.

About this Topic