I'm not sure why the foreach loop is still printing an array for my $education
variable. This code is supposed to get the custom post fields. It works with the title, the image and the about variable, but not when the variable has been put in an array.
<?php $args = array( 'post_type' => 'team members', 'posts_per_page' => 40 , 'paged' => 1,);
$loop = new WP_Query( $args );
$counter = 1;
while ( $loop->have_posts() ) : $loop->the_post();
$title = get_the_title();
$about = get_post_custom_values('about');
$education = get_post_custom_values('education');
$certications = get_post_custom_values('certications');
$image_upload = get_post_meta($post->ID, 'profile_image', true); // CALL IMAGE
echo '<div class="tab blue black '. join( ' ', get_post_class() ) .'"><input id="inputnumber' . $counter . '" type="checkbox" name="group1" class="trigger"><label for="inputnumber' . $counter . '">' . $title . '</label> <span class="content">' . $about[0] . '</span></div>';
foreach($education as $value) {
echo $value; // Displays "12" (there are 12 tracks on this album)
}
echo wp_get_attachment_image($image_upload); // Echo image
endwhile;
?>
UPDATE: vardump prints the number of populated rows, but not the actual content of these rows. The custom field I am trying to call is a small table with content.
echo "$value";
I thinkecho $value;
foreach($education as $key => $value)
so you're not echoing the keys.foreach($education as $key => $value){echo $value }
; possibly do avar_dump($education)
before the cycle, to see exactly what's in there