have_posts() ){ while ( $query->have_posts() ){ $query->the_post(); $item_class = array(); $categories = ''; $terms = get_the_terms(get_the_ID(),'portfolio-types'); if( is_array( $terms ) ){ foreach( $terms as $term ){ $item_class[] = 'category-'. $term->slug; $categories .= ''. $term->name .', '; } $categories = substr( $categories , 0, -2 ); } $item_class[] = get_post_meta( get_the_ID(), 'mfn-post-size', true ); $item_class[] = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; $item_class = implode(' ', $item_class); $external = mfn_opts_get( 'portfolio-external' ); $ext_link = get_post_meta( get_the_ID(), 'mfn-post-link', true ); $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' ); // item backgrounds --- // style: list if( $item_bg_image = get_post_meta( get_the_ID(), 'mfn-post-bg', true ) ){ $item_bg_image = ' background-image:url('. $item_bg_image .');'; } // style: masonry hover $item_bg_class = 'bg-'. mfn_brightness( mfn_opts_get( 'background-imageframe-link', '#2991d6' ), 169 ); if( $item_bg_color = get_post_meta( get_the_ID(), 'mfn-post-bg-hover', true ) ){ $item_bg_class = 'bg-'. mfn_brightness( $item_bg_color, 169 ); $item_bg_color = ' background-color:'. hex2rgba( $item_bg_color, 0.9 ) .';'; } // Image Link --------------------------------------------------------------------- if( in_array( $external, array('disable','popup') ) ){ // disable details & link popup $link_before = ''; } elseif( $external && $ext_link ){ // link to project website $link_before = ''; } else { // link to project details $link_before = ''; } // Echo --------------------------------------------------------------------------- $output .= '
  • '; if( $style == 'exposure' ){ // style: Exposure -------------------------------------------------------- $output .= $link_before; // photo ------------------ $output .= '
    '; $output .= get_the_post_thumbnail( get_the_ID(), 'full', array( 'class'=>'scale-with-grid', 'itemprop'=>'image' ) ); $output .= '
    '; $output .= '
    '; // title ------------------ $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    '. get_the_title() .'

    '; $output .= '
    '; $output .= get_the_excerpt(); $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; // details ------------------- $output .= '
    '; $output .= '
    '; $output .= '
    '; if( $link = get_post_meta( get_the_ID(), 'mfn-post-link', true ) ){ $output .= '
    '; $output .= '
    '. $translate['website'] .'
    '; $output .= '
    '. $translate['view'] .'
    '; $output .= '
    '; } if( $client = get_post_meta( get_the_ID(), 'mfn-post-client', true ) ){ $output .= '
    '; $output .= '
    '. $translate['client'] .'
    '; $output .= '
    '. $client .'
    '; $output .= '
    '; } $output .= '
    '; $output .= '
    '. $translate['date'] .'
    '; $output .= '
    '. get_the_date() .'
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; } elseif( $style == 'masonry-minimal' ){ // style: Masonry Minimal --------------------------------------------------- $output .= '
    '; $output .= '
    '; $output .= mfn_post_thumbnail( get_the_ID(), 'portfolio', 'masonry-minimal' ); $output .= '
    '; $output .= '
    '; } elseif( $style == 'masonry-hover' ){ // style: Masonry Hover --------------------------------------------------- $output .= '
    '; // desc ------------------- $output .= '
    '; $output .= '
    '; $output .= '

    '. $link_before . get_the_title() .'

    '; $output .= '
    '; $output .= get_the_excerpt(); $output .= '
    '; $output .= '
    '; if( $external != 'disable' ){ $output .= ''; } $output .= '
    '; // photo ------------------ $output .= '
    '; $output .= $link_before; $output .= get_the_post_thumbnail( get_the_ID(), 'full', array( 'class'=>'scale-with-grid', 'itemprop'=>'image' ) ); $output .= ''; $output .= '
    '; $output .= '
    '; } else { // style: All ------------------------------------------------------------- $output .= '
    '; $output .= '
    '; if( $style == 'list' ) $output .= '
    '; // style: List | Section Wrapper // style: List | Desc --------------------------------------------- $output .= '
    '; $output .= '

    '. $link_before . get_the_title() .'

    '; $output .= ''; $output .= '
    '; // style: All | Photo --------------------------------------------- $output .= '
    '; $output .= '
    '; $output .= mfn_post_thumbnail( get_the_ID(), 'portfolio', $style ); $output .= '
    '; $output .= '
    '; // style: All | Desc ---------------------------------------------- $output .= '
    '; $output .= '
    '; $output .= '
    '. $link_before . get_the_title() .'
    '; $output .= '
    '. mfn_love() .'
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; if( $client = get_post_meta( get_the_ID(), 'mfn-post-client', true ) ){ $output .= '
    '. $translate['client'] .'
    '; $output .= '
    '. $client .'
    '; } $output .= '
    '. $translate['date'] .'
    '; $output .= '
    '. get_the_date() .'
    '; if( $link = get_post_meta( get_the_ID(), 'mfn-post-link', true ) ){ $output .= '
    '. $translate['website'] .'
    '; $output .= '
    '. $translate['view'] .'
    '; } $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= get_the_excerpt(); $output .= '
    '; $output .= '
    '; if( $style == 'list' ) $output .= '
    '; // style: List | end: Section Wrapper $output .= '
    '; } $output .= '
  • '; } } return $output; } }