/*
Template Name: Photos
*/
get_header(); ?>
while(have_posts()){ the_post();?>
$current = $post->ID;
$parent = $post->post_parent;
$args = array(
'post_type'=>'page',
'orderby'=>'modified',
'order'=>'DESC',
'post_parent'=>$parent,
'posts_per_page'=>-1
);
$siblings = new WP_Query($args);
$imageargs = array (
'post_type' => 'attachment',
'post_mime_type' => 'image',
'posts_per_page' => -1,
'post_status'=> 'any',
'post_parent' => $current,
'orderby' => 'menu_order',
'order' => 'ASC',
'post__not_in' => array(get_post_thumbnail_id())
);
$images = new WP_Query($imageargs);
if ($images->have_posts()) {
?>
if(get_the_post_thumbnail()){?>
the_post_thumbnail('medium', array('class'=>'w100 hauto block'));?>
the_title();?>
}?>
if($siblings->have_posts()){
?>
} wp_reset_query();?>
$i = 0;
while($images->have_posts()) { $images->the_post();
$thumb = wp_get_attachment_image_src( $post->ID, 'medium');
$full = wp_get_attachment_image_src( $post->ID, 'full');
$adjH = ($i == 0 ?((620/$full[1])*$full[2]):((300/$thumb[1])*$thumb[2]));
?>
;?>)
$first4 = substr(get_the_title(), 0, 4);
if(is_numeric($first4)){?>
echo $first4;?>
}?>
li_share_buttons($images->post->ID, true);?>
the_title();?>
if (get_the_excerpt()){?>
echo get_the_excerpt();?>
}?>
$i++;
}?>
} //endif
wp_reset_query();
}//endwhile original query
?>
get_footer(); ?>