Support

Account

Home Forums General Issues Displaying CF values in posts

Solving

Displaying CF values in posts

  • Hi,

    I’m new using ACF and custom taxonomies.
    With ACF, I’ve created a custom field group titled “model bios”.
    For this field group, I’ve created such kind of fields : “model_birthday”, “model_birthdate”…
    I’ve created a custom taxonomy titled “Models” with Ultimate CMS plug-in and in my “models bio” location set-up, I’ve added the rule Taxonomy Term = Models

    On each post, I would like to display the values of the custom fields “model_birthday”, “model_birthdate”… for the Model related with the post.
    As I also use Categories Images plug-in, using the following code,

    <?php foreach (get_the_terms(get_the_ID(), ‘models’) as $cat) : ?>
    term_id, ‘models’); ?>”>term_id); ?>” /><?php echo $cat->name; ?>
    <?php endforeach; ?>

    I’m able to retrieve, Model archive URL, Model image and Model name on each post.

    But when it comes to display all the value created with the Custom Fields such as “model_birthday”, “model_birthdate”… I feel unable to.
    As the basic

    <?php echo $cat->model_birthday ; ?>

    doesn’t work, I’ve made a lot of different attempts with “get_field()” and “the_field()” functions but wasn’t able to display any results on my posts.

    Thanks for your help.
    Fred

  • Aother attempt for the code that disappeared in the b-quote

    <?php foreach (get_the_terms(get_the_ID(), ‘models’) as $cat) : ?>
    term_id, ‘models’); ?>”>term_id); ?>” /><?php echo $cat->name; ?>
    <?php endforeach; ?>

  • Oops

    <?php foreach (get_the_terms(get_the_ID(), 'models') as $cat) : ?>
    <a href="<?php echo get_term_link($cat->term_id, 'models'); ?>"><img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /><?php echo $cat->name; ?> </a> </li>
    <?php endforeach; ?>
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.