Add value from Php array and increment next

I have an array which holds a list of colours.

<?php $colours = array("pink", "red", "blue", "green", "yellow", "grey", "cyan"); ?>

I then have a WordPress loop running to display posts. Is there a way that each post would have a value taken from the array and then the one after would have the other value?

For example:

First post:

Second post:

Read more here: Add value from Php array and increment next

Leave a Reply

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