Viewing File: /home/maglabs/conqmedia/wp-content/themes/bopea/inc/misc/layout-classic.php

<?php
if ( ! function_exists( 'bopea_lgrid' ) ) {
	function bopea_lgrid( $attrs ) {
		$module = shortcode_atts( array(
			'blockid'               => '',
			'section_style'      => 'large_layout1',
			'post_type'          => 'post',
			'term_slugs'         => '',
			'post_type_tax'      => '',
			'category'           => '',
			'categories'         => '',
			'format'             => '',
			'tags'               => '',
			'author'             => '',
			'post_not_in'        => '',
			'post_in'            => '',
			'order'              => '',
			'posts_per_page'     => '',
			'offset'             => '',
			'layout_style'       => 'large_layout1',
			'pagination'         => '',
			'tabs_link'       	 => '',
			'tabs_link_ids'   	 => '',
			'tabs_link_label' 	 => '',
			'jl_hide_cat'        => '',
			'jl_hide_author'     => '',
			'jl_hide_date'       => '',
			'jl_hide_meta'       => '',
			'jl_hide_desc'       => '',
			'jl_hide_line'       => '',
			'jl_hide_review'     => '',
			'jl_cus_img'     => '',
			'main_tag'     => 'h2',
			'ignore_sticky_posts' => '',
		), $attrs );		

		$module['style_mian']         = 'jl-main-block';
		$module['row_style_mian'] = 'jl-col-row';

		$total_posts = $module['posts_per_page'];		
		$query_data = bopea_query( $module );
		$module['posts_per_page'] = $total_posts;	
		$module['section_style'] = $module['layout_style'];

		ob_start();

		$atts_style   = array();
		$atts_style[] = 'block-section';		
		if ( ! empty( $module['style_mian'] ) ) {
			$atts_style[] = $module['style_mian'];
		}		
		if ( 'yes' === $module['jl_hide_cat'] ) {
			$atts_style[] = 'jl_hide_cat';
		}
		if ( 'yes' === $module['jl_hide_author'] ) {
			$atts_style[] = 'jl_hide_author';
		}
		if ( 'yes' === $module['jl_hide_date'] ) {
			$atts_style[] = 'jl_hide_date';
		}
		if ( 'yes' === $module['jl_hide_meta'] ) {
			$atts_style[] = 'jl_hide_meta';
		}
		if ( 'yes' === $module['jl_hide_desc'] ) {
			$atts_style[] = 'jl_hide_desc';
		}
		if ( 'yes' === $module['jl_hide_review'] ) {
			$atts_style[] = 'jl_hide_review';
		}
		if ( 'yes' === $module['jl_hide_line'] ) {
			$atts_style[] = 'jl_hide_line';
		}
		$atts_style = implode( ' ', $atts_style ); ?>		
		<div class="jl_clear_at <?php echo esc_attr( $atts_style ); ?>" <?php bopea_get_ajax_attributes( $module, $query_data ); ?>>		
		<?php
		bopea_block_tabs_link( $module );
		if ( $query_data->have_posts() ) :
			$atts_style = 'jl-roww jl_contain jl_lg_opt';
		if ( ! empty( $module['row_style_mian'] ) ) {
			$atts_style .= ' ' . $module['row_style_mian'];
		}?>
		<div class="jl_l_wrap_f jl_wrap_eb jl_clear_at">
			<div class="<?php echo esc_attr( $atts_style ); ?>">
			<?php			
			switch ( $module['layout_style'] ) {			
				case 'large_layout1' :
					bopea_large_layout1( $module, $query_data );
				break;
				case 'large_layout2' :
					bopea_large_layout2( $module, $query_data );
				break;
				case 'large_layout3' :
					bopea_large_layout3( $module, $query_data );
				break;
			}
			echo '</div>';
			bopea_blocknav( $module, $query_data );
			echo '</div>';
			wp_reset_postdata();			
		endif;
		echo '</div>';
		return ob_get_clean();
	}
}

if ( ! function_exists( 'bopea_large_layout1' ) ) :
	function bopea_large_layout1( $module = array(), $query_data = null ) {
		if ( method_exists( $query_data, 'have_posts' ) ) :
			$counter = 1;
			while ( $query_data->have_posts() ) :
				$query_data->the_post();?>
				<div class="jl_lg_op jl_lg_l1 jl_lasep">			
					<div class="jl_lg_op_in">                    					
						<?php if ( has_post_thumbnail()) {?>
						<div class="jl_img_holder">
						<div class="jl_imgw jl_radus_e">
							<div class="jl_imgin">
								<?php
								if ($module['jl_cus_img'] != '' ) {
									the_post_thumbnail($module['jl_cus_img']);
								}else{
									the_post_thumbnail('bopea_medium');
								}?>
							</div>
							<?php bopea_video_media(get_the_ID());?>
							<?php bopea_review_bar(get_the_ID(), get_post_meta( get_the_ID(), true ));?>
							<a class="jl_imgl" aria-label="<?php the_title()?>" href="<?php the_permalink();?>"></a>
							<?php bopea_post_tumb_cat(get_the_ID());?>
						</div>
						</div>
						<?php }?>
						<div class="jl_fe_text">
							<?php bopea_post_cat(get_the_ID());?>
							<?php if(empty($module['main_tag'])){?>
							<h3 class="h3 jl_fe_title jl_txt_2row"><a href="<?php the_permalink(); ?>"><?php the_title()?></a></h3>
							<?php }else{?>
								<<?php echo esc_attr($module['main_tag']);?> class="h3 jl_fe_title jl_txt_2row"><a href="<?php the_permalink(); ?>"><?php the_title()?></a></<?php echo esc_attr($module['main_tag']);?>>
							<?php }?>
							<p class="jl_fe_des"><?php echo wp_trim_words( get_the_excerpt(), 22, '...' );?> </p>
							<?php bopea_post_meta(get_the_ID());?>							
						</div>
					</div>			
				</div>
			<?php endwhile;			
		endif;
	}
endif;

if ( ! function_exists( 'bopea_large_layout2' ) ) :
	function bopea_large_layout2( $module = array(), $query_data = null ) {
		if ( method_exists( $query_data, 'have_posts' ) ) :
			$counter = 1;
			while ( $query_data->have_posts() ) :
				$query_data->the_post();?>
				<div class="jl_lg_op jl_lg_l2 jl_lasep">
					<div class="jl_lg_op_in">
						<div class="jl_ov_layout jl_ov_el jl_ov_mh">
						<?php if ( has_post_thumbnail()) {?>
							<div class="jl_img_holder">
								<div class="jl_imgw">
									<div class="jl_imgin">
										<?php
										if ($module['jl_cus_img'] != '' ) {
											the_post_thumbnail($module['jl_cus_img']);
										}else{
											the_post_thumbnail('bopea_layouts');
										}?>
									</div>
									<?php bopea_video_media(get_the_ID());?>
									<?php bopea_review_bar(get_the_ID(), get_post_meta( get_the_ID(), true ));?>
									<a class="jl_imgl" aria-label="<?php the_title()?>" href="<?php the_permalink();?>"></a>
								</div>
							</div>
						<?php }?>
							<div class="jl_fe_text">
								<div class="jl_fe_inner">
								<?php bopea_post_ov_cat(get_the_ID());?>
								<h3 class="jl_fe_title jl_txt_2row"><a href="<?php the_permalink(); ?>"><?php the_title()?></a></h3>
								<p class="jl_fe_des"><?php echo wp_trim_words( get_the_excerpt(), 22, '...' );?> </p>
								<?php bopea_post_meta(get_the_ID());?>
								<a href="<?php the_permalink(); ?>" aria-label="<?php the_title()?>" class="jl_cap_ov"></a>
								</div>
							</div>
						</div>
					</div>			
				</div>
			<?php endwhile;			
		endif;
	}
endif;

if ( ! function_exists( 'bopea_large_layout3' ) ) :
	function bopea_large_layout3( $module = array(), $query_data = null ) {		
		if ( method_exists( $query_data, 'have_posts' ) ) :
			$counter = 1;
			while ( $query_data->have_posts() ) :
				$query_data->the_post();?>
				<div class="jl_lg_op jl_lg_l3 jl_lasep">
					<div class="jl_lg_op_in">
						<div class="jl_ov_layout jl_ov_el jl_ov_mh">
						<?php if ( has_post_thumbnail()) {?>
							<div class="jl_img_holder">
								<div class="jl_imgw">
									<div class="jl_imgin">
										<?php
										if ($module['jl_cus_img'] != '' ) {
											the_post_thumbnail($module['jl_cus_img']);
										}else{
											the_post_thumbnail('bopea_layouts');
										}?>
									</div>
									<?php bopea_video_media(get_the_ID());?>
									<?php bopea_review_bar(get_the_ID(), get_post_meta( get_the_ID(), true ));?>
									<a class="jl_imgl" aria-label="<?php the_title()?>" href="<?php the_permalink();?>"></a>
								</div>
							</div>
						<?php }?>
							<div class="jl_fe_text">
								<div class="jl_fe_inner">
								<?php bopea_post_ov_cat(get_the_ID());?>
								<h3 class="jl_fe_title jl_txt_2row"><a href="<?php the_permalink(); ?>"><?php the_title()?></a></h3>
								<p class="jl_fe_des"><?php echo wp_trim_words( get_the_excerpt(), 22, '...' );?> </p>
								<?php bopea_post_meta(get_the_ID());?>
								<a href="<?php the_permalink(); ?>" aria-label="<?php the_title()?>" class="jl_cap_ov"></a>
								</div>
							</div>
						</div>
					</div>			
				</div>
			<?php endwhile;			
		endif;
	}
endif;
Back to Directory File Manager