Support

Account

Home Forums Front-end Issues ACF and Genesis Reply To: ACF and Genesis

  • did/would this work? :

    <?php 
    $name_of_the_training = get_posts(array(
    	'post_type' => 'training', //search posttypes of this name
    	'meta_query' => array(
    		array(
    		'key' => 'name_of_the_training', // with a custom field of this name (has to be a relationship field!)
    		'value' => '"' . get_the_ID() . '"', // look for post that has this ID  (matches exaclty "123", not just 123. This prevents a match for "1234")
    		'compare' => 'LIKE'
    		)
    	)
    ));
    if ($name_of_the_training ) {
    foreach( $name_of_the_training  as $training){
     echo  "<span>" .get_field('number_of_days', $training->ID). " days</span><br/>";
     echo "<span>" .get_field('price', $training->ID). " euros</span><br/>";
     }
    }
    ?>