I'm displaying all categories with their respective images, as per the code below:
<?php
categorias = apply_filters('taxonomy-images-get-terms', '', array( 'taxonomy' => 'category') );
foreach($categorias as $key => $categoria):
if($key < 6):
?>
<div class="box">
<a href="<?php echo get_category_link($categoria->term_id);?>">
<figure>
<?php echo wp_get_attachment_image($categoria->image_id,''); ?>
</figure>
<img src="<?php bloginfo('template_directory');?>/images/icones/plus.png" class="plus-icone" alt="">
<figcaption class="titulo-foto-categoria"><?php echo $categoria->name;?></figcaption>
</a>
</div>
<?php
endif;
endforeach;?>
The apply_filters
function was used to display the category image, so far as I could find on the internet, only this way it can be done. So I noticed this function shows all results in alphabetical order and I need to show them randomly or by date.
Is it possible to do this?