Create a dynamic list of categories display like a masonry loop
-
My site is using a custom child theme I made from GeneratePress. I made posts on archive pages appear in a simple masonry layout. See: here
For the index page, I would like to have it display my post categories as thumbnails in a masonry layout as well. To make it easier to explain, I did some simple html coding to match how my loop displays in archives and added it to my index page (see here.)
As you’ll see, the first block is how I’d like each category to appear (I plan on using a plugin to give each category a featured image of its own). The second block shows what is outputted using
<?php wp_list_categories('orderby=name&style=none'); ?>
The above code creates the list I need, but I do not know how to style it to display how I envisioned. I think I would need to clone this function and make my own based off of it but I’m not sure what to change/include in the custom function.
Can someone guide me on what to do to get my categories to be automatically listed in masonry blocks?
- The topic ‘Create a dynamic list of categories display like a masonry loop’ is closed to new replies.