9

Taxonomy Image, Description and Archive link using Advanced Custom Fields

Here’s another snippet of code I had to trawl through hundreds o posts to get working, while dealing with Custom Post Types and their associated Taxonomies, you may want to also add an image and also use the default Category/Taxonomy Description alongside it, below is the code to allow you to do exactly that, the one thing to make sure is to set up your custom field rules correctly.

First create a Image custom field within ACF with a Return Value of ‘Array’ an then in order for the Meta Box to display you must select the following within the ‘Location’ Meta Box.

Select ‘Taxonomy Term’ from within the ‘Show this field if’ selection menu, also select ‘is equal to’ and then select the appropriate Category or Taxonomy.

Once this is setup the Meta Box show appear within your Categories & Taxonomies. The code below will render your Categories/Taxonomies by each term within a List Item which includes a link to that specific Category/Taxonomy Archive, the image you’ve uploaded and the main Category & Taxonomy Description.

You can achieve this task in various ways within WordPress but Advanced Custom Fields makes the task a lot less stressful and most importantly more user friendly for your client.

9