Would you like to add images to taxonomies in WordPress? Taxonomies allow you to group data in WordPress. Categories and tags are two default taxonomies that are integrated with each WordPress blog. In this tutorial, we will show you how to add images to taxonomies in WordPress. In other words, you will be able to add image icons for your custom categories, tags, and other taxonomies.

How to add images to taxonomies

Why add images to WordPress taxonomies?

Custom publishing formats and taxonomies allow WordPress to become a full-fledged CMS. By default, WordPress comes with categories and tags, which are the default taxonomies that you can use to sort your articles.

You can also create your own custom taxonomies and associate them with custom post formats on your WordPress blog. This allows your users to see all other content available in taxonomies.

With images on taxonomies, you can add images or icons to each taxonomy.

For example, each category on your site can have its own icon, which can be displayed on category archive pages, category lists, and so on.

With that said, let's take a look at how to easily add taxonomy images to WordPress.

How to add images on taxonomies WordPress

The first thing you need to do is to install and activate the plugin " taxonomy Images ". For more details, see our step-by-step guide on way to install a WordPress plugin.

After activating the plugin, you must access " Settings> Taxonomy Images ”to configure the plugin settings.

Configuration of the taxonomy images plugin

You will see a list of taxonomies available on your WordPress site. Select the taxonomies where you want to activate the images and click the Save Changes button.

In the screenshot above, we have enabled images on categories.

To add images to each category, you will need to access " Articles> Categories ».

If you have enabled images on other taxonomies, you will need to access them from your dashboard as well.

On the category page, you'll notice a new column labeled " Image In your list of your categories. Since you haven't added images to categories yet, this will display an empty image by default with an add button for each category.

Add image to categories

Go ahead and click the Add button below the blank image. This will bring up the add WordPress image pop-up window.

You can select an image from WordPress image library or upload a new image. After that, go ahead and repeat the process to add images for all categories.

You can delete an image at any time simply by clicking on the button Delete " (Remove).

How to display images on WordPress taxonomies

To display taxonomy images on your WordPress site, you will need to edit your WordPress theme or child theme.

First you will need to connect to your WordPress site using an FTP client.

Once logged in, you will need to find the model responsible for viewing the Taxonomy Archives. This could be archives.php, category.php, tag.php or taxonomy.php.

You must download the file to your computer and open it in a text editor such as Notepad or TextEdit.

Now paste the following code where you want to display the image for your taxonomy. Usually, you will add it before the title of the taxonomy or the "the_archive_title ()" tag.

apply_filters print ( 'taxonomy-image queried-term image', '');

After adding the code, you need to save this file and upload it to your Website using the same FTP client.

You can now visit the taxonomy archive page to see it displaying your taxonomy image. This is what it might look like.

Overview of taxonomies on wordpress

You can use CSS to give a little more style to your layout.

That's all for this tutorial, I hope it will allow you to add the images to the one on WordPress taxonomies.