a:3:{i:2;a:3:{s:5:"title";s:0:"";s:4:"text";s:4222:"		<?php
			
			$cat = "";
			$getId = '';
			if(is_single() == 1) { // following are variables which are set when page is not post listing page
				$getId = get_the_ID();
				$cat_arr = wp_get_post_categories(get_the_ID());
				foreach($cat_arr as $cat) {
					// Check if this particular post comes under News category or not
					if($cat == 4) {  //4 is news category id 
						$cat = "news";
					}
				} // end of foreach
			} // end of if condition 
		?>
		<div class="col-md-3 col-sm-5 padding_right">
			<div class="rytdetail">
			<div class="Recent_blog">
					<h1>Recent Blogs</h1>
					<div class="slimscroll">
						<div class="slimscrollinner">
						
							<?php   // Query to get all year
								global $wpdb;
								$years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts p JOIN $wpdb->term_relationships r ON r.object_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = 'post' ORDER BY p.post_date DESC");
								
								foreach($years as $year) :												// foreach to get year
									// Query to get month with respect to year
									$results = $wpdb->get_results("SELECT MONTH(p.post_date) as month, ID FROM $wpdb->posts p JOIN $wpdb->term_relationships r ON r.object_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = 'post' AND YEAR(p.post_date) = '".$year."' AND r.term_taxonomy_id = 2 ORDER BY p.post_date DESC");
										$activeHead = ""; // intialize variable for showing month class
										$monthArr = array();

										foreach($results as $month) : // foreach for setting variable if month is post month
											if($getId != "" ) { 
												if($month->ID == $getId) {
														$activeHead = $month->month;
													} 
												} else { 	
													$activeHead = 0;
												}
											$monthArr[] = $month->month;	
										endforeach;		
										
										$months = array_unique($monthArr);
										
										foreach($months as $month) :								// foreach to get month
											if($activeHead == $month) { 
												$activeClass = "style='display:block'"; 	
												$tab = "open_tab";
												$heading_blog = "active";
											 } else { 
												$activeClass = "style='display:none'"; 	
												$tab = "";	
												$heading_blog = "";
											 }    // setting variable if month is post month
											?>
												<div class="blog_listout ">
												<span class="heading_blog <?php echo $heading_blog; ?>"><?php echo date( 'F', mktime(0, 0, 0, $month) )." ".$year; ?><label class="close_tab <?php echo $tab; ?>"></label></span>
													<ul class="blog_inlist" <?php echo $activeClass; ?> >
													<?php  
													//Query to get posts with respect to month
													 $theids = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND MONTH(post_date)= '".$month."' AND YEAR(post_date) = '".$year."' ORDER BY post_date DESC");
														 
														 foreach ($theids as $theid):							// foreach to get post 
															$category = get_the_category($theid->ID);
																if($category[0]->cat_name == "blog") {       // if condition to check category is blog or not 
																	if(isset($getId) && $getId == $theid->ID) { $active = "active"; } else { $active = ""; }
																 ?>
																	<li><a href= "<?php echo $theid->guid; ?>" class="<?php echo $active; ?>" ><?php echo $theid->post_title; ?></a></li>
															<?php 
																}  // end of if
														endforeach;   // End of  Post Foreach ?>
													
													</ul>
												</div><!-- end of blog_listout-->
								<?php
												$tab = "";	
											endforeach;  // End of  month Foreach ?>
							<?php	endforeach;  // End of  year Foreach ?>
							</div>
						</div>
				</div>
			<div class="add_top">
				<img src="<?php echo get_template_directory_uri(); ?>/images/first_add.jpg" alt="0" border="0" />
			</div>
			<div class="add_bottom">
				<img src="<?php echo get_template_directory_uri(); ?>/images/second_add.jpg" alt="0" border="0" />
			</div>
			</div>
		</div>
";s:6:"filter";b:0;}i:3;a:3:{s:5:"title";s:0:"";s:4:"text";s:4088:"		<?php 
			if($postslug) {
				$getId = get_ID_by_slug($postslug);
			} else {
				$getId = 0;
			}
			echo $getId; 
		?>
		<div class="col-md-3 col-sm-5 padding_right ">
			<div class="rytdetail">
			<!--There are two conditions when NEWS are to be shown i.e if page id is of NEWS i.e 38 OR second if post detail is under NEWS category-->
			<div class="Recent_blog">
					<h1>Recent News</h1>
					<div class="slimscroll">
						<div class="slimscrollinner">
						
							<?php   // Query to get all year
								global $wpdb;
								$years = $wpdb->get_col("SELECT DISTINCT YEAR(p.post_date) FROM $wpdb->posts p JOIN $wpdb->term_relationships r ON r.object_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = 'post' ORDER BY p.post_date DESC");
								
								foreach($years as $year) :												// foreach to get year
									// Query to get month with respect to year
									$results = $wpdb->get_results("SELECT MONTH(p.post_date) as month,ID FROM $wpdb->posts p JOIN $wpdb->term_relationships r ON r.object_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = 'post' AND YEAR(p.post_date) = '".$year."' AND r.term_taxonomy_id = 4 ORDER BY p.post_date DESC");
										$activeHead = ""; // intialize variable for showing month class
										$monthArr = array();
										
										foreach($results as $month) : // foreach for setting variable if month is post month
											if($getId != "" ) { 
												echo $month->ID."fff";
												if($month->ID == $getId) {
														$activeHead = $month->month;
													} 
												} else { 	
													$activeHead = 0;
												}
											$monthArr[] = $month->month;	
										endforeach;		
										
										$months = array_unique($monthArr);
										
										foreach($months as $month) :								// foreach to get month
											if($activeHead == $month) { 
												$activeClass = "style='display:block'"; 	
												$tab = "open_tab";
												$heading_blog = "active";
											 } else { 
												$activeClass = "style='display:none'"; 	
												$tab = "";	
												$heading_blog = "";
											 }    // setting variable if month is post month
											?>
												<div class="blog_listout ">
												<span class="heading_blog <?php echo $heading_blog; ?>"><?php echo date( 'F', mktime(0, 0, 0, $month) )." ".$year;?><label class="close_tab <?php echo $tab; ?>"></label></span>
													<ul class="blog_inlist" <?php echo $activeClass; ?> >
													<?php  
													//Query to get posts with respect to month
													 $theids = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND MONTH(post_date)= '".$month."' AND YEAR(post_date) = '".$year."' ORDER BY post_date DESC");
														 
														 foreach ($theids as $theid):							// foreach to get post 
															$category = get_the_category($theid->ID);
																if($category[0]->cat_name == "News") {       // if condition to check category is news or not 
																	if(isset($getId) && $getId == $theid->ID) { $active = "active"; } else { $active = ""; }
																 ?>
																	<li><a href= "<?php bloginfo( "url" )."".$theid->post_name; ?>" class="<?php echo $active; ?>" ><?php echo $theid->post_title; ?></a></li>
															<?php 
																}  // end of if
														endforeach;   // End of  Post Foreach ?>
													
													</ul>
												</div><!-- end of blog_listout-->
								<?php
												$tab = "";	
											endforeach;  // End of  month Foreach ?>
							<?php	endforeach;  // End of  year Foreach ?>
							</div>
						</div>
				</div>
			<div class="add_top">
				<img src="<?php echo get_template_directory_uri(); ?>/images/first_add.jpg" alt="0" border="0" />
			</div>
			<div class="add_bottom">
				<img src="<?php echo get_template_directory_uri(); ?>/images/second_add.jpg" alt="0" border="0" />
			</div>
			</div>
		</div>
";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}