Support

Account

Home Forums ACF PRO Getting ACF field from a taxonomy in a page with WP_query Reply To: Getting ACF field from a taxonomy in a page with WP_query

  • Edit the right code :

    					<?php $args = array(
    						'taxonomy' => 'marques-produits',
    					    'orderby' => 'name',
    					    'order'   => 'ASC'
    					    );	
    					$cats = get_categories($args);
    					foreach($cats as $cat) {
    						$logo = get_field('logo_marque', 'marques-produits_'. $cat->term_id .'');
    						echo 
    						'<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( __( "Voir tout les produits %s" ), $cat->name ) . '">
    							<img src="' . $logo['url']; ?>" alt="<?php echo $logo['alt'] . '">
    						</a>';
    						}
    					?>