I have a post meta for image uploads which allows a maximum of 5 files.
The data is stored in like this:
a:5:{i:0;s:3:"694";i:1;s:3:"694";i:2;s:3:"697";i:3;s:3:"695";i:4;s:3:"696";}
The problem is, I can't get the image URLs. My code:
<?php $ppics = get_post_meta( get_the_ID(), 'shop_demosc', false );
$ppurl = wp_get_attachment_url($ppics);
foreach ($ppics as $key => $ppurl){
echo '<img src="'. print_r($ppurl) .'">';
} ?>
This code returns:
Array
(
[0] => 694
[1] => 694
[2] => 697
[3] => 695
[4] => 696
)
whats wrong? How can I get the URLs to the 5 images?
var_dump($ppics);
var_dump($ppics[0]);
?