How to show multiple featured collections

Hello,
I am trying to show every collection on the homepage that I have tagged as featured, rather than just 1 random rotating collection.

I know I have to do something in the index.html here:

<?php if (get_theme_option('Display Featured Collection') !== '0' && count(get_random_featured_collection()) > 0): ?>
<?php echo random_featured_collection(0); ?>

but everything I have tried has errored out. Any suggestions?

1 Like

This function allows to display only one featured random collection. To display all of them, you have to replace it with something like (0 means all):

<?php 
if (get_theme_option('Display Featured Collection') !== '0' 
    && $featuredCollections = get_records('Collection', array('featured' => 1, 'sort_field' => 'random'), 0)
):
    foreach ($featuredCollections as $collection): 
        echo $this->partial('collections/single.php', array('collection' => $collection));
        release_object($collection);
    endforeach;
else: 
    echo '<p>' . __('No featured collections are available.') . '</p>';
endif; 
?>