Support

Account

Home Forums General Issues Need all custom field entries comma delimeted from all custom post type entries Reply To: Need all custom field entries comma delimeted from all custom post type entries

  • k, so there’s an obvious typo in my code, proof that the brain sees what you expect to see since I missed it at least 4 times. Tell me if you can spot the difference

    
    $args = array(
      'post_type' => 'locations',
      'posts_per_page' => -1
    );
    $query = new WP_Query($args);
    $facebook_ids = array();
    if ($query->have_posts()) {
      while($query->have_posts()) {
        $query->the_post();
        echo get_field('facebook_group_name').'<br />';
        $facebook_ids[] = get_field('facebook_group_name');
      }
      wp_reset_postdata();
    }
    echo implode(',', $facebook_ids);