Weblogtoolscollection News » Wordpress News

Category Order and My Category Order plugins compared

  • Topic started 5 years ago
  • 2 posts so far
  • Latest reply from froman118

  1. If you have ever needed to manage the order of how categories are displayed in a theme, then two similarly name plugins, Category Order or My Category Order, might be the solution to your problem.

    WordPress offers the wp_list_categories() template tag to display categories, but only allows the order to be set to category ID, name, slug, or count. Fortunately, these two plugins provide a method to manually designate the order of categories.

    Category Order

    Category Order, by Wessley Roche, allows ordering of categories with an easy to use, drag-and-drop process. The ordering process is accessed under a Posts->Category Order menu screen. The top level categories display, and each category can be dragged, up or down, and dropped to the desired location on the list. A button, "Click the Order Categories," saves the order.

    Categories with children (descendants or subcategories) have a 'More >' link next to the parent category name, and when clicked, displays the children categories of that parent category. Each of the children can be ordered by dragging the category, up or down the list. If a child category, in turn has children, then a 'More >' link does a drill-down to that category for ordering.

    After the order of categories is saved, it is just a matter of making sure the wp_list_categories() template tag is used in a theme template file. The use of the code, <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>, which already exists in the WordPress Default theme's sidebar.php file, is all that is necessary to display the categories. The native Categories Widget will use the order set by this plugin.

    Note that this plugin saves the order values in two records ('category_children' and 'wpguy_category_order') in the 'wp_options' table. There is no uninstall option to remove those records from the 'wp_options' table. As for author support of this plugin, which is accessed via the order-categories tag, there aren't enough questions in the Forums to measure the author's response to problems. Donate to the plugin author at: http://wpguy.com/plugins/category-order

    My Category Order

    My Category Order, by Andrew Charlton (froman118), also provides an easy to use, drag-and-drop interface with the My Category Order choice, under the Posts menu. The plugin displays two ordering sections, one for main (top) level categories. and one for subcategories (descendants or children). To order the main level categories, under the "Order Categories" section, drag-and-drop those categories, up or down the list, then click on the "Click to Order Categories" button to save the settings.

    To order subcategories, select the parent category in the Subcategories pull down and click the "Order Subcategories" button to drill-down to the next descendant level. At that point, drag-and-drop those subcategories, up or down the list, then click on the "Click to Order Categories" button to save the settings. If there are 'grandchildren', select that subcategory in the pull down, click the "Order Subcategories" button to drill-down to the next descendant level, and perform the drag-and-drop, and save process.

    The final step in using this plugin is to set the 'orderby=order' argument with the wp_list_categories() template tag. That template tag is typically in a theme's sidebar.php template file. An example of the code to use is <?php wp_list_categories('orderby=order&show_count=1&title_li=<h2>Categories</h2>'); ?>.

    Interestingly, this plugin saves the category order values in the 'term_order' column of the 'wp_terms' table. There is no plugin uninstall option that might restore the values of the 'term_order' column to zero. The plugin also includes a widget with extensive configuration options. French FR, Dutch NL, Polish PL, and Russian RU, translation .mo files are provided. The plugin author seems to do good job answering questions in the forums (see the tag my-category-order). Donate to the plugin author at: http://geekyweekly.com/mycategoryorder


    Both plugins perform as promised. The Category Order plugin is the simplest to use, as it may require no changes to a theme template file, but the My Category Order offers a highly configurable widget, and several translations. You can't go wrong using either plugin.

    Posted: 5 years #
  2. Thanks for the review of My Category Order. If you're wondering about "term_order" in the "wp_terms" table, it's a hold over from the early WP 2.0 days when they moved to the new taxonomy structure. The plugin actually creates the column so there aren't any previous values. The "term_order" column in the "wp_term_relationships" table was added a while back at someone's request so they could develop a plugin to manually order tags or something.

    Having it in the database makes it easy to sort on. Originally you could pass in anything on the orderby parameter and it would just append it to "term_". They changed that and if the order by parameter wasn't valid it defaulted to name or id. So to keep things running smoothly for the people already setup to use "orderby=order" in the template function I had to resort to taxonomy.php edits. Sadly, at one point people were having to manually overwrite their taxonomy.php. Now the plugin does it automatically.

    Been through lots of changes since I published it back in June 2006. If I ever get the time I'll work on submitting a patch for the ticket I opened to add ordering for categories, link categories and links.

    Posted: 5 years #

RSS feed for this thread

This topic has been closed to new replies.

Back to top

0.121 - 12 queries