I have an array of menu items that I'm printing out to the screen using a foreach loop into a single, continuous, unordered list. Because of CSS/design, they display on the screen in 3 columns in this order...
1 2 3
4 5 6
7 8 9
But I need them to display like this...
1 4 7
2 5 8
3 6 9
Is there a way I can, without changing the HTML structure and still within a single for/foreach loop, print out the same items so that they are arranged in the latter configuration?
Example code
<ul>
<?php
foreach($nav_menu as $nav):
echo "<li><a href='" . $nav->url . "'>" . $nav->title . "</a></li>";
endforeach;
?>
</ul>