Forum Replies Created

Viewing 16 replies (of 16 total)
  • Hi Guys,

    here is the code I have used to show category images on my front page. As you can see I have limited the results to three categories only. I am wondering if there is way to order the categories randomly so a different set of three show up each time the page is loaded?

    <?php
    $cats = get_categories('orderby=count&number=3&order=asc');
    foreach ((array)$cats as $cat) {
    $catdesc = $cat->category_description;
    echo '<a href="' . get_category_link($cat) . '" title="'. strip_tags($catdesc) .'"><img src="' . get_bloginfo ('template_url') . '/images/' . $cat->slug. '.png" alt="' . $cat->cat_name . '" class="front-img" /></a>';
    }
    ?>

    Regards,
    Troy

Viewing 16 replies (of 16 total)