Forums

My Category Order
Limits before establishing order? (2 posts)

  1. Creatier
    Member
    Posted 1 year ago #

    Hi all,

    I'm using the plugin My Category Order and I easily got it to work:
    <?php wp_list_categories('orderby=order&title_li=&style=none&hierarchical=false') ?>
    .. works like a charm as you can see here.

    On the homepage, however, I only want to output the first 3 categories when ordered by "order".
    You'd think this would be easy to establish by adding the parameter "number=3" as in:
    <?php wp_list_categories('orderby=order&title_li=&style=none&hierarchical=false&number=3') ?>
    ..but this doesn't work as expected. It appears that the ordering by order is done after the limiting, resulting in an output of three irrelevant items, which are then ordered by "order". I use this plugin in combination with the "Category & Page I c o n s" plugin to add the images to the wp_list_categories-output.
    wp-version is 3.0.1.

    Any help would be appreciated.
    I should note I'm not particularly looking for a fix for the issue of the plugin not working, I'm merely trying to echo the first three items of the orderby=order wp_list_categories. The "number=3" simply doesn't seem to fit the job. Any workaround will do.

    Thnx in advance!

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

  2. Creatier
    Member
    Posted 1 year ago #

    I should mention that when using another orderby parameter the ordering & limiting seems to work fine. (used on the front page right now, but must find a way to replace it with orderby=order without breaking it.)
    <?php wp_list_categories('orderby=id&order=desc&title_li=&style=none&hierarchical=true&depth=0&number=3'); ?>

    Any thoughts appreciated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic