Support

Account

Home Forums Front-end Issues Get multiple taxonomy fields from multiple taxonomy fields in a post

Solving

Get multiple taxonomy fields from multiple taxonomy fields in a post

  • I want to display multiple taxonomy fields from multiple taxonomy fields in a post.

    I cannot speak English well, so I draw a picture for explain.

    And part of my code:

    <?php
    get_header();
    $album = get_field('album');
    ?>
    <div class="column is-hidden-touch is-narrow" style="padding:1.5rem .75rem">
    	<?php
    	foreach( $album as $term ):
    		$image = get_field('cover', $term);
    	?>
    		<a href="<?php echo get_term_link( $term ); ?>" class="albumimg">
    			<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
    			<div>
    				<div>
    					<?php echo $term->name; ?><?php if( get_field('original_title', $term) ): ?><span><?php the_field('original_title', $term); ?></span><?php endif; ?>
    				</div>
    				<div>
    					<?php the_field('release', $term); ?>
    				</div>
    			</div>
    		</a>
    	<?php endforeach; ?>
    </div>

    Can I get some help?

  • To be honest, this does not really have to deal specifically with advancedcustomfields. Each of these elements can be found in WordPress documentation. Considering you use a taxonomy field.

    https://codex.wordpress.org/Function_Reference/get_taxonomy

  • Can it be used on existing theme ?

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Get multiple taxonomy fields from multiple taxonomy fields in a post’ is closed to new replies.