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

  • Nope. This didn’t solve it (and there were some missing closing semi-colons).

    I also tried with “explode” instead of “implode” and it didn’t work.

    Here’s my current code:

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