March 19, 2015
<ul> <?php $n = 0; foreach($page->children() as $child): $n++; ?> <li class="<?php echo ($n%2) ? 'odd' : 'even' ?>"> ... </li> <?php endforeach ?> </ul>
You can change “odd” and “even” to whatever names you need. Sourced here.
<ul> <?php $n = 0; foreach($page->children() as $child): $n++; ?> <li class="<?php echo ($n%2) ? 'odd' : 'even' ?>"> ... </li> <?php endforeach ?> </ul>
You can change “odd” and “even” to whatever names you need. Sourced here.
I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.