WordPress   

Get current post’s custom taxonomy including ACF field

$terms = get_the_terms( $post->ID , 'news_category' );
if ( $terms != null ){
	foreach( $terms as $term ) {
		echo '<a href="' . esc_url( get_category_link( $term->term_id ) ) . '" alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $term->name ) ) . '">' . esc_html( $term->name ) . '</a>';
		echo  get_field('news_cat_img', $term);
		unset($term);
	} 
}
Need a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us