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.

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 city of their choice to see deals specific to that city.

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 associated city taxonomy using a plugin like Custom Post Type UI.

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 ($27/month).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: