PHP Column Classes in Switch Case

<?php $related_content = count($query->query); switch (true) { case $related_content % 3 === 0: $class = 'three-column std-tablet-two-column sm-tablet-hundred sm-tablet-no-float'; break; case $related_content % 2 === 0: $class = 'two-column sm-tablet-hundred sm-tablet-no-float'; break; default: $class = 'three-column std-tablet-two-column sm-tablet-hundred sm-tablet-no-float'; break; } ?>
basic snippit I constantly use.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.