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
what kind of field is ‘facebook_group_name’ agian?
Then that shouldn’t be it.
What happens when you do this?
$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();
echo get_field('facebook_group_name').'<br />';
$facebook_ids[] = get_field('facebook_group_name');
}
wp_reset_postdata();
}
echo implode(',', $facebook_ids);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.