Hello,
i'm having a little bit of an issue with a portion of code ... It's for a portfolio gallery.
$sliders_out = '<div class="fx"><ul class="slides">';
foreach($slides as $slide)
{
$local = substr(str_replace(array(get_bloginfo('url'), '.jpg', '.png'), array('.', '', ''), $slide['slide_image']), 2);
$locals = array_merge(glob($local.'*1024*'), glob($local.'*768*'), glob($local.'*'));
rsort($locals);
if (isset($locals[0]))
$src = $locals[0];
else
$src = $locals[2];
$sliders_out .= '<li><img src="'.get_bloginfo('url').'/'.$src.'" /></li>';
}
$sliders_out .= '</ul></div>';
Altough the code works in random cases it outputs in the posts gallery images that are in the same folder as the rest of the pictures (uploaded in the same day as Wordpress puts them) but shouldn't be there
like wp-content/uploads/2014/12/11.jpg instead of wp-content/uploads/2014/12/1.jpg and 2014/12/8256509816_9642cdeaf7_h.jpg which has no corelation.
Any help is appreciated.