>
$list_img_cnt_start = $list_img_cnt_end = $list_txt_cnt_start = $list_txt_cnt_end = ''; if( 'list' == $blog_style ) { if ( in_array( "image", $elements ) ) { // Remove "image" from array and merge at start of array if (($key = array_search( "image", $elements) ) !== false) { unset($elements[$key]); } $elements = array_merge( array( 'image' ), $elements); $list_img_cnt_start = '
'; $list_img_cnt_end = '
'; $list_txt_cnt_start = '
'; $list_txt_cnt_end = '
'; } } // <-- // Loop through elements foreach ( $elements as $index => $element ) { // Featured Image if ( 'image' == $element ) { echo $list_img_cnt_start; get_template_part( 'template-parts/blog/media/blog-entry', bstone_get_post_format() ); echo $list_img_cnt_end; } if( 1 == $index ) { echo $list_txt_cnt_start; } // Title if ( 'post-title' == $element ) { get_template_part( 'template-parts/blog/header' ); } // Meta if ( 'post-meta' == $element ) { get_template_part( 'template-parts/blog/meta' ); } // Content if ( 'post-content' == $element ) { get_template_part( 'template-parts/blog/content' ); } // Read more button if ( 'read-more' == $element ) { get_template_part( 'template-parts/blog/readmore' ); } if( $element === end($elements) ) { echo $list_txt_cnt_end; } } ?>