• Resolved dguyen

    (@dguyen)


    Maybe I’m missing something. I truly apologize if this is been resolved before, but I could not find the solution.

    I want to list the terms for my custom taxonomy associated with each post. Currently I’m using:

    <?php echo $terms = get_the_term_list( $post->ID, 'skills'); ?>

    which works great, but the items are in a string. How can I put each term into a list item

    … I tried the foreach but returns an invalid argument.

    Can anyone help shed some light? Thanks so much in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • check once get_term_by_slug() function. see on codex

    Thread Starter dguyen

    (@dguyen)

    So far I’ve decided to separate the terms with a comma, then exploding the terms and include a foreach statement.

    <?php get_the_term_list( $post->ID, 'skills', '', ', ');
    $skills = explode(',',get_the_term_list( $post->ID, 'skills-proficiencies', '', ', '));
    foreach ($skills as $skill) { ?>
    <li><?php echo $skill; ?></li>
    <?php } ?>

    Someone please let me know if there’s a better solution.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List customy taxonomy terms associated with current post.’ is closed to new replies.