WordPress.org

Ready to get started?Download WordPress

Forums

Upgraded to 2.8.2, "get_categories" not working... (2 posts)

  1. Jeffrey Cannon
    Member
    Posted 4 years ago #

    I just upgraded to WordPress 2.8.2 and this piece of code in my theme is no longer working...

    <ul id="prodCats">
    <?php
    $categories = get_categories('orderby=order');
    foreach ($categories as $cat) {
    	if ($cat->category_nicename != 'general') {
    		if ($cat->category_parent == 0) { ?>
    			<li><a href="<?php echo get_option('home');?>/products/#<?php echo $cat->category_nicename; ?>">
    				<img src="<?php echo get_option('home');?>/catImgs/<?php echo $cat->category_nicename; ?>.jpg" />
    				<p class="catName"><?php echo $cat->cat_name; ?></p>
    			</a></li>
    <?php 	}
    	}
    } ?>
    </ul>
  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    orderby=order

    Not a supported argumenet according to the codex..
    http://codex.wordpress.org/Function_Reference/get_categories#Parameters

    Valid values are name or ID..

    You may wish to consider adapting your code to utilise wp_list_categories instead which supports additional parameters.
    http://codex.wordpress.org/Template_Tags/wp_list_categories

Topic Closed

This topic has been closed to new replies.

About this Topic