How to get a count of all posts in foreach loop and split into fourths

I have this loop:

<?php
$categories = get_terms(‘my_category’);
foreach ( $categories as $category ) :
?>

I want to split the posts into 4 separate div columns so that post titles will be alphabetical vertically like:

a | d | g | j
b | e | h | k
c | f | i | l

How do you get the total post count and divide evenly into fourths?

Read more here:: How to get a count of all posts in foreach loop and split into fourths

Leave a Reply

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