		<?php 
$category_icon_code = "";
$category_icon_color = "";
$your_image_url = "";
$caticoncolor="";
$category_icon ="";
			  global $current_view_type;
			  global $permalink_type;
			  global $redux_demo;
			  $ad_desc = $redux_demo['ad-desc'];
		?>
<div class="advTopBar">
	<div class="large-8 medium-6 columns tabb tabs data-tab responsive-tabber">
		<ul class="tabs" data-tab>
			<li class="tab-title active"><a href="#panel1"><?php esc_html_e( 'Latest Ads', 'classiera' ); ?></a></li>
			<li class="tab-title"><a href="#panel2"><?php esc_html_e( 'Popular Ads', 'classiera' ); ?></a></li>
			<li class="tab-title"><a href="#panel3"><?php esc_html_e( 'Random Ads', 'classiera' ); ?></a></li>
		</ul>
	</div><!-- End large-8-->
	<div class="large-4 medium-6 columns view tabs data-tab responsive-tabber">
		<span><?php esc_html_e( 'View As', 'classiera' ); ?></span>
		<a class="act1 <?php if($current_view_type == 'list'){ echo "active";} ?>" href="<?php echo get_category_link(get_cat_ID(single_cat_title('', false))).$permalink_type."view-type=list"; ?>"><i class="fa fa-list"></i></a>
		<a class="act3 <?php if($current_view_type == 'grid'){ echo "active";} ?>" href="<?php echo get_category_link(get_cat_ID(single_cat_title('', false))).$permalink_type."view-type=grid"; ?>"><i class="fa fa-th-large"></i></a> 
	</div><!-- End large-4-->
</div><!-- End advTopBar-->
<div class="row">
	<div class="advContent">
		<div class="tabs-content listView">
			<div class="content active clearfix" id="panel1">
			<div class="loop-content">
				<?php 
					global $paged, $wp_query, $wp;
					$args = wp_parse_args($wp->matched_query);
					if ( !empty ( $args['paged'] ) && 0 == $paged ) {
						$wp_query->set('paged', $args['paged']);
						$paged = $args['paged'];
					}
					$cat_id = get_cat_ID(single_cat_title('', false));
					$temp = $wp_query;
					$wp_query= null;
					$wp_query = new WP_Query();
					$wp_query->query('post_type=post&posts_per_page=12&paged='.$paged.'&cat='.$cat_id);
					$current = -1;
					$current2 = 0;
				?>
				<?php while ($wp_query->have_posts()) : $wp_query->the_post(); $current++; $current2++; ?>
				<div class="large-12 medium-12 columns advItems">
				<?php 
				/*Get Category Extra Fields For Price Icon Background */
					$category = get_the_category();
						if ($category[0]->category_parent == 0) {
							$tag = $category[0]->cat_ID;
							$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
							if (isset($tag_extra_fields[$tag])) {
								$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
								$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
							}
						}else{
							$tag = $category[0]->category_parent;
							$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
							if (isset($tag_extra_fields[$tag])) {
								$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
								$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
							}
						}
						if(!empty($category_icon_code)) {
							$category_icon = stripslashes($category_icon_code);
						}
						$category_icon_code = "";
						$postCatgory = get_the_category( $post->ID );
						$post_price = get_post_meta($post->ID, 'post_price', true);
						$comments_count = wp_count_comments( $post->ID  );
						$approvedComment = $comments_count->approved;
				/*Get Category Extra Fields For Price Icon Background */
				?>
					<article class="listAdv clearfix">
						<div class="large-4 medium-4 small-5 column removePad">
							<div class="list-img">
								<?php if(!empty($post_price)){ ?>
								<span class="listPrice" style="background-color:<?php echo $category_icon_color; ?>"><?php echo $post_price; ?></span>
								<?php }?>
								<?php /*Start Image */
								if ( has_post_thumbnail()) {
										$imageurl = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'classiera-list');
										$thumb_id = get_post_thumbnail_id($post->id);
										$alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);
										?>
										<img src="<?php echo $imageurl[0]; ?>" alt="<?php if(empty($alt)){echo "Image";}else{ echo $alt; } ; ?>"/>
										<?php										
									}else{
										?>
										<img src="<?php echo get_template_directory_uri() . '/images/nothumb/nothumb270x250.png' ?>" alt="No Thumb"/>
										<?php
									}									
									/*End Image */?>
								<div class="listcomment">
									<span><?php echo $approvedComment; ?></span>
									<i class="fa fa-comments"></i>
									<span><?php echo classiera_get_post_views($post->ID); ?></span>
									<i class="fa fa-eye"></i>
								</div>	<!-- End listcomment-->
							</div>							
						</div><!-- End large-4 removePad-->	
						<div class="large-8 medium-8 small-7 column extraPad">
							<div class="listAdv-desc">
								<div class="row collapse">
									<div class="large-8 medium-9 columns">
										<div class="listAdv-desc-header">
											<div class="icon">
												<i class="<?php echo $category_icon; ?>" style="background-color:<?php echo $category_icon_color; ?>"></i>
												<?php 
												$theTitle = get_the_title();
												if(is_rtl()){
													$theTitle = get_the_title();
												}else{
													$theTitle = (strlen($theTitle) > 30) ? substr($theTitle,0,30).'...' : $theTitle;
												}
												?>
												<h4><a href="<?php the_permalink(); ?>"><?php echo $theTitle; ?></a></h4>
												<span><?php esc_html_e( 'Category', 'classiera' ); ?> &nbsp;:&nbsp;<?php echo $postCatgory[0]->name; ?></span>
											</div>
										</div>
									</div><!-- End large-8-->
									<div class="large-4 medium-3 column">
									<?php if(function_exists('the_ratings')) { ?>
										<div class="rating">
											<?php the_ratings(); ?>
										</div>
									<?php } ?>	
									</div><!-- End large-4-->
								</div><!-- End First Row-->
								<div class="row collapse">
									<div class="large-12 columns">
										<div class="listAdv-desc-detail">
											<?php echo substr(get_the_excerpt(), 0,140); ?>
										</div>
									</div>
								</div><!-- End Second Row-->
								<div class="row collapse">
									<div class="listAdv-tags listAdv-tags1 clearfix">
										<div class="large-7 medium-7 columns removePad">
											<div class="listTags">
												<i class="fa fa-tags"></i>
												<span><?php esc_html_e('Tags', 'classiera'); ?>:</span>
												<?php the_tags('','',''); ?>
											</div><!-- listTags-->
										</div><!-- large-7-->
										<div class="large-5 medium-5 columns removePad">
											<div class="listReadMore removePad">
												<a href="<?php the_permalink(); ?>">
												<?php esc_html_e( 'Read More', 'classiera' ); ?>
												</a>
											</div>
										</div><!-- large-5-->
									</div><!-- listAdv-tags-->
								</div><!-- End Third Row-->
							</div><!-- End listAdv-desc-->
						</div><!-- End large-8 removePad-->
					</article>
				</div><!-- End Single Post Entry-->
				<?php endwhile; ?>
			</div><!--loop-content-->	
			<?php 
			global $redux_demo;
			$scroll = $redux_demo['infinite-scroll'];
			?>
			<?php if($scroll == 1){ ?>
				<?php echo infinite($wp_query); ?>
			<?php }else{ ?>
				<!-- Begin classiera_pagination-->
				<?php get_template_part('pagination'); ?>
				<?php wp_reset_query(); ?>
				<!-- End classiera_pagination-->
			<?php } ?>	
				
			</div><!-- End panel1-->
			
			<div class="content clearfix" id="panel2">
			<div class="loop-content2">
			<?php 
				global $paged, $wp_query, $wp;
				$args = wp_parse_args($wp->matched_query);
				if ( !empty ( $args['paged'] ) && 0 == $paged ) {
						$wp_query->set('paged', $args['paged']);
						$paged = $args['paged'];
					}
				$cat_id = get_cat_ID(single_cat_title('', false));
				$current = -1;
				$current2 = 0;
				$popularpost = new WP_Query( array( 'posts_per_page' => '12', 'cat' => $cat_id, 'posts_type' => 'post', 'paged' => $paged, 'meta_key' => 'wpb_post_views_count', 'orderby' => 'meta_value_num', 'order' => 'DESC'  ) );
				while ( $popularpost->have_posts() ) : $popularpost->the_post(); $current++; $current2++;
			?>
				<div class="large-12 medium-12 columns advItems">
				<?php 
				/*Get Category Extra Fields For Price Icon Background */
					$category = get_the_category();
						if ($category[0]->category_parent == 0) {
							$tag = $category[0]->cat_ID;
							$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
							if (isset($tag_extra_fields[$tag])) {
								$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
								$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
							}
						}else{
							$tag = $category[0]->category_parent;
							$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
							if (isset($tag_extra_fields[$tag])) {
								$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
								$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
							}
						}
						if(!empty($category_icon_code)) {
							$category_icon = stripslashes($category_icon_code);
						}
						$category_icon_code = "";
						$postCatgory = get_the_category( $post->ID );
						$post_price = get_post_meta($post->ID, 'post_price', true);
						$comments_count = wp_count_comments( $post->ID  );
						$approvedComment = $comments_count->approved;
				/*Get Category Extra Fields For Price Icon Background */
				?>
					<article class="listAdv clearfix">
						<div class="large-4 medium-4 small-5 column removePad">
							<div class="list-img">
								<?php if(!empty($post_price)){ ?>
								<span class="listPrice" style="background-color:<?php echo $category_icon_color; ?>"><?php echo $post_price; ?></span>
								<?php }?>
								<?php /*Start Image */
								if ( has_post_thumbnail()) {
										$imageurl = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'classiera-list');
										$thumb_id = get_post_thumbnail_id($post->id);
										$alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);
										?>
										<img src="<?php echo $imageurl[0]; ?>" alt="<?php if(empty($alt)){echo "Image";}else{ echo $alt; } ; ?>"/>
										<?php										
									}else{
										?>
										<img src="<?php echo get_template_directory_uri() . '/images/nothumb/nothumb270x250.png' ?>" alt="No Thumb"/>
										<?php
									}
									/*End Image */?>
								<div class="listcomment">
									<span><?php echo $approvedComment; ?></span>
									<i class="fa fa-comments"></i>
									<span><?php echo classiera_get_post_views($post->ID); ?></span>
									<i class="fa fa-eye"></i>
								</div>	<!-- End listcomment-->
							</div>							
						</div><!-- End large-4 removePad-->	
						<div class="large-8 medium-8 small-7 column extraPad">
							<div class="listAdv-desc">
								<div class="row collapse">
									<div class="large-8 medium-9 columns">
										<div class="listAdv-desc-header">
											<div class="icon">
												<i class="<?php echo $category_icon; ?>" style="background-color:<?php echo $category_icon_color; ?>"></i>
												<?php 
												$theTitle = get_the_title();
												if(is_rtl()){
													$theTitle = get_the_title();
												}else{
													$theTitle = (strlen($theTitle) > 30) ? substr($theTitle,0,30).'...' : $theTitle;
												}
												?>
												<h4><a href="<?php the_permalink(); ?>"><?php echo $theTitle; ?></a></h4>
												<span><?php esc_html_e( 'Category', 'classiera' ); ?> &nbsp;:&nbsp;<?php echo $postCatgory[0]->name; ?></span>
											</div>
										</div>
									</div><!-- End large-8-->
									<div class="large-4 medium-3 column">
									<?php if(function_exists('the_ratings')) { ?>
										<div class="rating">
											<?php the_ratings(); ?>
										</div>
									<?php } ?>	
									</div><!-- End large-4-->
								</div><!-- End First Row-->
								<div class="row collapse">
									<div class="large-12 columns">
										<div class="listAdv-desc-detail">
											<?php echo substr(get_the_excerpt(), 0,140); ?>
										</div>
									</div>
								</div><!-- End Second Row-->
								<div class="row collapse">
									<div class="listAdv-tags listAdv-tags1 clearfix">
										<div class="large-7 medium-7 columns removePad">
											<div class="listTags">
												<i class="fa fa-tags"></i>
												<span><?php esc_html_e('Tags', 'classiera'); ?>:</span>
												<?php the_tags('','',''); ?>
											</div><!-- listTags-->
										</div><!-- large-7-->
										<div class="large-5 medium-5 columns removePad">
											<div class="listReadMore removePad">
												<a href="<?php the_permalink(); ?>">
												<?php esc_html_e( 'Read More', 'classiera' ); ?>
												</a>
											</div>
										</div><!-- large-5-->
									</div><!-- listAdv-tags-->
								</div><!-- End Third Row-->
							</div><!-- End listAdv-desc-->
						</div><!-- End large-8 removePad-->
					</article>
				</div><!-- End Single Post Entry-->
				
				<?php endwhile; ?>
			</div><!--loop-content2-->
			<?php 
			global $redux_demo;
			$scroll = $redux_demo['infinite-scroll'];
			?>
			<?php if($scroll == 1){ ?>
				<?php echo infinite($popularpost); ?>
			<?php }else{ ?>
				<!-- Begin classiera_pagination-->
				<?php wp_reset_query(); ?>
				<?php get_template_part('pagination'); ?>
				<!-- End classiera_pagination-->
			<?php } ?>	
				
			</div><!-- End panel2-->
			
			<div class="content clearfix" id="panel3">
			<div class="loop-content3">
				<?php 
					global $paged, $wp_query, $wp;
					$args = wp_parse_args($wp->matched_query);
					if ( !empty ( $args['paged'] ) && 0 == $paged ) {
						$wp_query->set('paged', $args['paged']);
						$paged = $args['paged'];
					}
					$cat_id = get_cat_ID(single_cat_title('', false));
					$temp = $wp_query;
					$wp_query= null;
					$wp_query = new WP_Query();
					$wp_query->query('orderby=title&post_type=post&posts_per_page=12&paged='.$paged.'&cat='.$cat_id);
					$current = -1;
					$current2 = 0;					
				?>
				<?php while ($wp_query->have_posts()) : $wp_query->the_post(); $current++; $current2++; ?>
				<div class="large-12 medium-12 columns advItems">
				<?php 
				/*Get Category Extra Fields For Price Icon Background */
					$category = get_the_category();
						if ($category[0]->category_parent == 0) {
							$tag = $category[0]->cat_ID;
							$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
							if (isset($tag_extra_fields[$tag])) {
								$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
								$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
							}
						}else{
							$tag = $category[0]->category_parent;
							$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
							if (isset($tag_extra_fields[$tag])) {
								$category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
								$category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
							}
						}
						if(!empty($category_icon_code)) {
							$category_icon = stripslashes($category_icon_code);
						}
						$category_icon_code = "";
						$postCatgory = get_the_category( $post->ID );
						$post_price = get_post_meta($post->ID, 'post_price', true);
						$comments_count = wp_count_comments( $post->ID  );
						$approvedComment = $comments_count->approved;
				/*Get Category Extra Fields For Price Icon Background */
				?>
					<article class="listAdv clearfix">
						<div class="large-4 medium-4 small-5 column removePad">
							<div class="list-img">
								<?php if(!empty($post_price)){ ?>
								<span class="listPrice" style="background-color:<?php echo $category_icon_color; ?>"><?php echo $post_price; ?></span>
								<?php }?>
								<?php /*Start Image */
								if ( has_post_thumbnail()) {
										$imageurl = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'classiera-list');
										$thumb_id = get_post_thumbnail_id($post->id);
										$alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);
										?>
										<img src="<?php echo $imageurl[0]; ?>" alt="<?php if(empty($alt)){echo "Image";}else{ echo $alt; } ; ?>"/>
										<?php										
									}else{
										?>
										<img src="<?php echo get_template_directory_uri() . '/images/nothumb/nothumb270x250.png' ?>" alt="No Thumb"/>
										<?php
									}
									/*End Image */?>
								<div class="listcomment">
									<span><?php echo $approvedComment; ?></span>
									<i class="fa fa-comments"></i>
									<span><?php echo classiera_get_post_views($post->ID); ?></span>
									<i class="fa fa-eye"></i>
								</div>	<!-- End listcomment-->
							</div>							
						</div><!-- End large-4 removePad-->	
						<div class="large-8 medium-8 small-7 column extraPad">
							<div class="listAdv-desc">
								<div class="row collapse">
									<div class="large-8 medium-9 columns">
										<div class="listAdv-desc-header">
											<div class="icon">
												<i class="<?php echo $category_icon; ?>" style="background-color:<?php echo $category_icon_color; ?>"></i>
												<?php 
												$theTitle = get_the_title();
												if(is_rtl()){
													$theTitle = get_the_title();
												}else{
													$theTitle = (strlen($theTitle) > 30) ? substr($theTitle,0,30).'...' : $theTitle;
												}
												?>
												<h4><a href="<?php the_permalink(); ?>"><?php echo $theTitle; ?></a></h4>
												<span><?php esc_html_e( 'Category', 'classiera' ); ?> &nbsp;:&nbsp;<?php echo $postCatgory[0]->name; ?></span>
											</div>
										</div>
									</div><!-- End large-8-->
									<div class="large-4 medium-3 column">
									<?php if(function_exists('the_ratings')) { ?>
										<div class="rating">
											<?php the_ratings(); ?>
										</div>
									<?php } ?>	
									</div><!-- End large-4-->
								</div><!-- End First Row-->
								<div class="row collapse">
									<div class="large-12 columns">
										<div class="listAdv-desc-detail">
											<?php echo substr(get_the_excerpt(), 0,140); ?>
										</div>
									</div>
								</div><!-- End Second Row-->
								<div class="row collapse">
									<div class="listAdv-tags listAdv-tags1 clearfix">
										<div class="large-7 medium-7 columns removePad">
											<div class="listTags">
												<i class="fa fa-tags"></i>
												<span><?php esc_html_e('Tags', 'classiera'); ?>:</span>
												<?php the_tags('','',''); ?>
											</div><!-- listTags-->
										</div><!-- large-7-->
										<div class="large-5 medium-5 columns removePad">
											<div class="listReadMore removePad">
												<a href="<?php the_permalink(); ?>">
												<?php esc_html_e( 'Read More', 'classiera' ); ?>
												</a>
											</div>
										</div><!-- large-5-->
									</div><!-- listAdv-tags-->
								</div><!-- End Third Row-->
							</div><!-- End listAdv-desc-->
						</div><!-- End large-8 removePad-->
					</article>
				</div><!-- End Single Post Entry-->
				<?php endwhile; ?>
			</div><!--loop-content3-->
			<?php 
			global $redux_demo;
			$scroll = $redux_demo['infinite-scroll'];
			?>
			<?php if($scroll == 1){ ?>
				<?php echo infinite($wp_query); ?>
			<?php }else{ ?>			
				<!-- Begin classiera_pagination-->
				<?php wp_reset_query(); ?>
				<?php get_template_part('pagination'); ?>
				<!-- End classiera_pagination-->
			<?php }?>	
				
			</div>	<!--End Panel3 -->	
			
		</div><!-- End tabs-content-->
	</div><!-- End advContent-->
</div><!-- End Main Row-->