<?php echo $item_count = count(get_field('field_name_of_relationship')); ?>

방법 1 : Code Block을 이용한 방법 - TEXT

<?php echo strip_tags( get_the_term_list( get_the_ID(), 'my_taxonomy', '', ', ' ) ) ?>

방법2 : Code Block을 이용하는 또 다른 방법 -DIV

Code Block의 Width 값을 100%로 설정해야 함.

<?php
	$post_id = get_the_ID();

        $taxonomy= 'my_taxonomy';

	$terms = get_the_terms($post_id, $taxonomy);

	if ($terms) {
      $term_arr = array();

	    foreach ($terms as $term) {
          $name = $term->name;
          $term_arr[] = $name;
        }
      
      $my_terms = implode (", ", $term_arr);
      
    }
?>

<div class=""><?php echo $my_terms; ?></div>

방법3 : CSS를 이용하는 방법

요소에 클래스를 부여하고 pointer-events: none으로 설정함.

E.g:
.your-class a { pointer-events: none; }

 

예를 들어, order_value라는 필드를 생성한 후 이를 높은 순서대로 배열하고자 한다면,

Advanced Query에서 'orderby' => 'meta_value', 'meta_key' => 'order_value'

로 설정하면 된다.

코드블락을 이용하여 아래 코드에서 do_shortcode('["'.get_field('field_name').'"]');를 참고하여 숏코드에 동적 필드를 대입할 수 있습니다.

<?php
	echo do_shortcode( '[ameliabooking service="'.get_field('amelia_id').'"]' );
?>

예를 들어, 라고 가정할 때, mp3에 대한 필드를 audio_mp3라는 필드로 만들고

<?php
	echo do_shortcode( '[audio src="'.get_field('audio_mp3').'"]' );
?>

로 만듭니다.

Insert Dynamic Data에서 Advanced > PHP Function Return value 에서

Function Name : get_sub_field

Function Arguments : 해당 필드의 Field Name을 입력합니다.

이때 ACF Repeater의 Return Image Format 은 Image URL로 설정합니다.

power-switchmagnifiercross