Home Forums ACF PRO Output comma with get_field


Output comma with get_field

  • Hello all,

    I would like to output the name and the degree in this format: John Doe, PhD

    My code is follow:

    $degree = get_field( 'degree', $post->ID );
    <h4 class="block-slider-faculty__slide__details__title"><?php the_title(); ?><?php echo implode(', ', $degree); ?></h4>

    I got the “Warning: Implode(): invalid arguments passed in…” error.

    I believe I need to put the $degree in an array? Please let me know how I can do that with the code above. Thank you for your help.

  • what type of field is “degree”?

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

You must be logged in to reply to this topic.