Sometimes things that should be easy are hard…

Today, I needed to display an Advanced Custom Fields (ACF) image on a custom taxonomy page.  Here’s the solution:

First, create the image field and apply it to the taxonomy like this:

Make sure you have the image field set to output the “Image Array” like this:

Now, go to your taxonomy term and add an image like this:

Finally, copy-and-paste code to your functions.php:

add_action( 'loop_end', 'output_before_taxonomy_loop' );
function output_before_taxonomy_loop(){
	if (is_tax()) {
		// Display the artist image
		$queried_object = get_queried_object();
		$taxonomy = $queried_object->taxonomy;
		$term_id = $queried_object->term_id;
		$terms = get_field( 'artist_image', $taxonomy.'_'.$term_id);
		if( $terms ) {
			echo '<img src="'. $terms['url'] .'" />';
		} else {
		    //do nothing

Finally, baske in the glory that is Advanced Custom Fields’ taxonomy image fields!

Artist is https://cryns.com

Ain’t life grand? Well…mostly?


We love to communicate: phone, email, text, Facebook, Twitter, LinkedIn, you name it.



Call Now

Enroll in Our Free Beginner WordPress Class - delivered to your Email Inbox!

Become a WordPress superstar for FREE in only minutes a day!  Our free Beginner WordPress Email Class will be delivered to your inbox!

Learn More 

You Have Successfully Enrolled! Prepare For Amazing!