Random Loop Filter

Hi guys wondering if anyone can help. I have this code that lists all sub pages, their featured image and title/link. What I’d like to be able to do is randomize the the size of the featured image between what WordPress offers… small/medium/large?

Any ideas?

$args = array(
    'parent' => 2,
    'post_type' => 'page',
    'post_status' => 'publish'
$pages = get_pages($args);  ?>
foreach( $pages as $page ) {

    <a href="<?php echo  get_permalink($page->ID); ?>" rel="bookmark" title="<?php echo $page->post_title; ?>">
    <div><span class="thumbnail"><?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?></span>
    <span class="title"><?php echo $page->post_title; ?></span></div>

Read more here: Random Loop Filter

Leave a Reply

Your email address will not be published. Required fields are marked *