WordPress: display random links

Many people have taken notice of the random links I display in my sidebar and frequently ask me how I do it. Really, there is no magic, spiffy script or even a WordPress plugin. It’s simply a matter of defining how you want to order your links list! Typical order includes ASC, DESC, name, or URL. In the case of a randomized links list, you want to order by rand.

Example of usage:

get_links(0, '<li>', '</li>', '', 0, 'rand', 0, 0, 10);

Please note that in the example, ten links from all categories are shown, links are contained within a list, and URLs and descriptions are not shown.


Page last updated on 10/10/2007.