Home Forums Front-end Issues Custom taxonomy show ID's instead of name


Custom taxonomy show ID's instead of name

  • So i’ve been looking for ever to get this to work. By I have a custom taxonomy “functie” that is liked to ACF “ook_inzetbaar_als”. I got this to work. But it only shows me the ID’s and not the names of the checked fields.

    Here is a screenshot of the ACF:

    And here is the code that give me the ID’s but I want the Names.

    $ook = get_field('ook_in_zetbaar_als');
    <?php if( $ook): ?>
    	<td class="td-top"valign="top">Inzet:</td>
    	    <?php foreach( $ook as $ook ): ?>
    	      <li><?php echo $ook; ?></li>
    	    <?php endforeach; ?>
    <?php endif; ?>

    I’ve looked everywhere and tried all kinds of snippets.

    <a href="">

    <a href=""></a>
    <a href=""></a>
    <a href=""></a>
    <a href=""></a>

    But nothing works for me. Could you please help?

  • Hi @puur

    Demonstrated in this Taxonomy doc, you could change the line in your code where you create the “li” and echo $ook to be something like:

    <li><?php echo $ook->name; ?></li>

    In the same code on the above linked page, it also shows how to get the link and description.

    Hope that helps!

  • Excellent! Thanks for the quick reply!

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

You must be logged in to reply to this topic.