- ';
for ( $j=0; $j < count($posts); $j++ ) {
$post_id = $posts[$j]->ID;
setup_postdata($posts[$j]);
$excerpt = get_the_excerpt();
$attachment_url = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'full' );
$url = $attachment_url['0'];
$image = aq_resize($url, $thumb_width, $thumb_height, true);
$mediaType = get_post_meta($post_id, 'tz_portfolio_type', true);
$prettyType = 0;
if ($count > $columns) {
$count = 1;
$output .= '
- ';
if(has_post_thumbnail($post_id) && $mediaType == 'Image') {
$prettyType = 'prettyPhoto-'.$rand;
$output .= '
'; $output .= ''; $output .= ' '; } elseif ($mediaType != 'Video' && $mediaType != 'Audio') { $thumbid = 0; $thumbid = get_post_thumbnail_id($post_id); $images = get_children( array( 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $post_id, 'post_mime_type' => 'image', 'post_status' => null, 'numberposts' => -1 ) ); if ( $images ) { $k = 0; //looping through the images foreach ( $images as $attachment_id => $attachment ) { $prettyType = "prettyPhoto-".$rand ."[gallery".$i."]"; //if( $attachment->ID == $thumbid ) continue; $image_attributes = wp_get_attachment_image_src( $attachment_id, 'full' ); // returns an array $img = aq_resize( $image_attributes[0], $thumb_width, $thumb_height, true ); //resize & crop img $alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true); $image_title = $attachment->post_title; if ( $k == 0 ) { if (has_post_thumbnail($post_id)) { $output .= ''; $output .= '
'; $output .= ''; $output .= ' '; } else { $output .= '
'; $output .= ''; $output .= ' '; } } else { $output .= ' '; $k++; } } elseif (has_post_thumbnail($post_id)) { $prettyType = 'prettyPhoto-'.$rand; $output .= '
'; $output .= ''; $output .= ' '; } } else { // for Video and Audio post format - no lightbox $output .= ''; $output .= '
'; $output .= ' '; } $output .= ''; $output .= ''; $output .= '
'; if ($type=="jobs") { if ($i<10) { $output .= '0'.$counter.'. '; } else { $output .= ''.$counter.'. '; } } $output .= ''; $output .= get_the_title($post_id); $output .= '
'; if ($meta == 'yes') { // begin post meta $output .= ' '; // end post meta } if($excerpt_count >= 1){ $output .= ''; $output .= my_string_limit_words($excerpt,$excerpt_count); $output .= '
'; } if($link){ $output .= ''; $output .= $link_text; $output .= ''; } $output .= ' ';
if ($j == count($posts)-1) {
$output .= $output_end;
}
if ($count % $columns == 0) {
$output .= '
- ';
}
$output .= '