• I’m trying to use the wp_tag_cloud function to display a list of random tags. When I put a value in for “number,” it always limits the list to the same tags, and then displays those in a random order. It never displays the other tags.

    Just to be clear, I’m working on a test site that has these seven tags:
    – tag 1
    – tag 2
    – tag 3
    – tag 4
    – tag 5
    – tag 6
    – tag 7

    When I limit the number of tags to 4, it always displays the same four tags in a random order. However, I want it to select four different tags from the complete list every time.

    I think I’m looking for the ‘orderby’ parameter to have a ‘RAND’ value, but currently all I can assign to it is ‘name’ or ‘count.’ (Note – this is not the ‘order’ parameter.)

    Here’s what I have now:

    <?php if ( function_exists('wp_tag_cloud') ) : ?>
    <?php wp_tag_cloud('smallest=10&largest=10&number=4&order=RAND'); ?>
    <?php endif; ?>

    Any help would be great!

  • The topic ‘Use of orderby=RAND with wp_tag_cloud?’ is closed to new replies.