- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am on the last step in a tutorial that I followed [here](http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-4-using-the-data/ “http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-4-using-the-data/”) , called “Using the data”.
I tried using//
echo '[ul class="album_repeatable"]';
foreach ($album_repeatable as $string) {
echo '[li]'.$string.'[/li]';
}
echo '[/ul]';
?>
But I get the Warning as stated in Discussion Title//
“_Warning: Invalid argument supplied for foreach()_ “
What exactly is the issue here, in terms I could understand? lol
Please help me fix this?…
**SOLUTION**//
Used normal method to get field data instead of “_unserialize_”
Switched this line:
$album_repeatable = unserialize($post_meta_data[0]);
to this line:
$album_repeatable = get_post_meta($post->ID, 'album_repeatable', true);
Now my repeatable field Data is being displayed.
@traq I appreciate you trying to explain, just wish I understood it lol!
But yeah…thank you :)