Ok, my long day is catching up with me... I am trying to list out custom post meta fields and keep getting Notice: Undefined index: related-headline in... Here is what the array looks like:
Array ( [0] => Array ( [0] => Array ( [related-headline] => Street Outlaws Turbo Rotary Mazda RX-7 – OKC NoPrep [related-url] => //localhost:3000/street-outlaws-turbo-rotary-mazda-rx-7-okc-noprep/ [related-image_id] => 78055 [related-image] => //localhost:3000/wp-content/uploads/2015/12/lucky-to-be-alive-distracted-dri.jpg ) [1] => Array ( [related-headline] => In the Driver’s Seat: Shane vs. The Reaper | Street Outlaws [related-url] => //localhost:3000/in-the-drivers-seat-shane-vs-the-reaper-street-outlaws/ [related-image_id] => 78048 [related-image] => //localhost:3000/wp-content/uploads/2015/12/ford-f350-vs-dodge-ram-vs-chevy.jpg ) ) )
Here is my code:
$entries = get_post_meta( get_the_ID(), 'ss-related-posts' );
// print_r($entries);
foreach ( (array) $entries as $key => $entry ) {
$title = '';
$title = $entry['related-headline'];
echo $title;
}
I know I am missing something simple here so any help would be most appreciated.