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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: