This members-only tutorial provides the steps to display a grid of taxonomy terms with term image and title appearing for each item in the grid when using Oxygen.
We shall set each item to link to the term archive page.
Update on 13 Mar 2022: Added instructions to set this up for WooCommerce product categories.
Use Case
Let's say you have a CPT called deal
with an associated city
taxonomy so that deals can be organized by city. Now you want to have a page that shows all the cities so visitors can go to
This tutorial shows you how we can add obtain all the cities and loop over them to show the city image plus name and use CSS Grid to arrange them in a grid.
Step 1
Let's register a custom image size for the city images.
Install and activate Code Snippets plugin.
Go to Snippets > Add New.
Title: Custom image sizes
Code:
add_image_size( 'square-thumbnail', 600, 600, true );
Step 2
If you have not already, register deal
CPT and city
Step 3
Let’s install a plugin so we can assign images to the city taxonomy's terms.
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.