6, 'cat' => 21, //'meta_key' => 'display_position', 'post_type' => 'post', ); $posts = query_posts($args); foreach ($posts as $post) : setup_postdata($post); $id = get_the_ID(); $pos = get_field('display_position',$id); if($pos == '0'){ array_push($top,array('title'=>get_the_title($id),'link'=>get_the_permalink($id),'thumbnail'=>get_the_post_thumbnail_url($id,'top-thumb'))); }elseif($pos=='1'){ array_push($mid,array('title'=>get_the_title($id),'link'=>get_the_permalink($id),'thumbnail'=>get_the_post_thumbnail_url($id,'mid-thumb'))); }elseif($pos=='2'){ array_push($bot,array('title'=>get_the_title($id),'link'=>get_the_permalink($id),'thumbnail'=>get_the_post_thumbnail_url($id,'bot-thumb'))); }elseif($pos=='3'){ array_push($vert,array('title'=>get_the_title($id),'link'=>get_the_permalink($id),'thumbnail'=>get_the_post_thumbnail_url($id,'vert-thumb'))); }elseif($pos=='4'){ array_push($full,array('title'=>get_the_title($id),'link'=>get_the_permalink($id),'thumbnail'=>get_the_post_thumbnail_url($id,'full-thumb'))); } endforeach; # code... ?>
'; foreach ($top as $t) { echo ''.$t['title'].''; } echo '
'; } ?> '; foreach ($mid as $m) { echo ''.$m['title'].''; } echo ''; } ?> '; foreach ($bot as $b) { echo ''.$b['title'].''; } echo ''; } ?> '; foreach ($vert as $v) { echo ''.$v['title'].''; } echo ''; } ?> '; foreach ($full as $v) { echo ''.$v['title'].''; } echo ''; } ?>