WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Categories listed in reverse order (3 posts)

  1. thewhatwherewhen
    Member
    Posted 5 years ago #

    Hello. I am currently working on a site, and I am looking for a way to list the categories in the side bar in reverse ID order..

    I found this wordpress codex help but it didn't work.. It said to put an underscore in front of the id and it would list them in reverse, but im wondering if my exclude etc is messing with it. Or it does say at the top of the codex

    This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists.

    Anyone have any ideas? This is my code.

    <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : // begin primary sidebar widgets ?>
    <li id="categories">
    <ul>
    <?php
    wp_list_categories('orderby=_id&exclude=&title_li=&child_of=3'); ?>

    And this is the site

  2. drmanry
    Member
    Posted 5 years ago #

    Instead of using the underscore, you use the DESC order value. Try this:

    <?php wp_list_categories('orderby=id&order=DESC&exclude=&title_li=&child_of=3'); ?>

  3. thewhatwherewhen
    Member
    Posted 5 years ago #

    you are a genius. Thanks so much!!

    Claire

Topic Closed

This topic has been closed to new replies.

About this Topic