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/>";
}
}
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.