<?php 
/* Template Name: BandOBash Homepage Widget Page Template */
?>

<?php
/**
 * The Header for the template.
 *
 * @package WordPress
 */
 
if (!isset( $content_width ) ) $content_width = 1170;

if(session_id() == '') {
	session_start();
}
 
global $letsblog_homepage_style;

?><!DOCTYPE html>
<html <?php language_attributes(); ?> <?php if(isset($pp_homepage_style) && !empty($pp_homepage_style)) { echo 'data-style="'.esc_attr($pp_homepage_style).'"'; } ?>>
<head>
<meta charset="<?php echo get_bloginfo( 'charset' ); ?>" />

<?php
	$tg_mobile_responsive = kirki_get_option('tg_mobile_responsive');
	
	if(!empty($tg_mobile_responsive))
	{
?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<?php
	}
?>

<meta name="format-detection" content="telephone=no">

<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<title><?php wp_title( '|', true, 'right' ); ?></title>

<?php
if(is_single())
{
	if(has_post_thumbnail(get_the_ID(), 'blog_f'))
	{
	    $image_id = get_post_thumbnail_id(get_the_ID());
	    $fb_thumb = wp_get_attachment_image_src($image_id, 'thumbnail', true);
	}

	if(isset($fb_thumb[0]) && !empty($fb_thumb[0]))
	{
		$post_content = get_post_field('post_excerpt', $post->ID);
	?>
	<meta property="og:image" content="<?php echo esc_url($fb_thumb[0]); ?>"/>
	<meta property="og:title" content="<?php echo esc_attr(get_the_title()); ?>"/>
	<meta property="og:url" content="<?php echo esc_url(get_permalink($post->ID)); ?>"/>
	<meta property="og:description" content="<?php echo esc_attr(strip_tags($post_content)); ?>"/>
	<?php
	}
}
?>

<?php
	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();

	$baseurl2 = "https://bandobash.com/";
?>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link href="https://fonts.googleapis.com/css?family=Merriweather+Sans:300,300i,400,400i,700,700i,800,800i|Nunito+Sans:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i|Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Qwigley" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet"> 

<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet"> 
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<?=$baseurl2?>/css/style.css">
<link rel="stylesheet" type="text/css" href="<?=$baseurl2?>/css/media.css">
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style.css">
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/bootstrap.js"></script>
</head>

<body <?php body_class(); ?>>

<?php
		//Check if disable right click
		$tg_enable_right_click = kirki_get_option('tg_enable_right_click');
		
		//Check if disable image dragging
		$tg_enable_dragging = kirki_get_option('tg_enable_dragging');
		
		//Check if use AJAX search
		$tg_menu_search_instant = kirki_get_option('tg_menu_search_instant');
		
		//Check if sticky menu
		$tg_fixed_menu = kirki_get_option('tg_fixed_menu');
		
		//Check if display top bar
		$tg_topbar = kirki_get_option('tg_topbar');
		if(THEMEDEMO && isset($_GET['topbar']) && !empty($_GET['topbar']))
		{
			$tg_topbar = true;
		}
		
		//Check if add blur effect
		$tg_page_title_img_blur = kirki_get_option('tg_page_title_img_blur');
		
		//Check filterable link option
		$tg_portfolio_filterable_link = kirki_get_option('tg_portfolio_filterable_link');
		
		//Check slider layout
		$tg_blog_slider_layout = kirki_get_option('tg_blog_slider_layout');
		if(THEMEDEMO && isset($_GET['layout']) && ($_GET['layout'] == 'fullwidth' OR $_GET['layout'] == 'full_fullwidth'))
		{
			$tg_blog_slider_layout = '3cols-slider';
		}
	?>
	<input type="hidden" id="pp_enable_right_click" name="pp_enable_right_click" value="<?php echo esc_attr($tg_enable_right_click); ?>"/>
	<input type="hidden" id="pp_enable_dragging" name="pp_enable_dragging" value="<?php echo esc_attr($tg_enable_dragging); ?>"/>
	<input type="hidden" id="pp_image_path" name="pp_image_path" value="<?php echo get_template_directory_uri(); ?>/images/"/>
	<input type="hidden" id="pp_homepage_url" name="pp_homepage_url" value="<?php echo esc_url(home_url()); ?>"/>
	<input type="hidden" id="pp_ajax_search" name="pp_ajax_search" value="<?php echo esc_attr($tg_menu_search_instant); ?>"/>
	<input type="hidden" id="pp_fixed_menu" name="pp_fixed_menu" value="<?php echo esc_attr($tg_fixed_menu); ?>"/>
	<input type="hidden" id="pp_topbar" name="pp_topbar" value="<?php echo esc_attr($tg_topbar); ?>"/>
	<input type="hidden" id="pp_page_title_img_blur" name="pp_page_title_img_blur" value="<?php echo esc_attr($tg_page_title_img_blur); ?>"/>
	<input type="hidden" id="tg_blog_slider_layout" name="tg_blog_slider_layout" value="<?php echo esc_attr($tg_blog_slider_layout); ?>"/>
	<input type="hidden" id="pp_back" name="pp_back" value="<?php _e( 'Back', THEMEDOMAIN ); ?>"/>

	<!-- Begin template wrapper -->
<div id="wrapper">
	
<div class="banq-section6">
	<div class="banq-section6-ind">
		<h2 class="center-text-banq Font-Nunito">Get latest trends: from our Blog updates</h2>
		
		<?php 
		//remove_filter ('the_content', 'wpautop');
		$args = array(
		    'post_type' => 'post',
		    'orderby' => 'rand',
		    'posts_per_page' => 4
		); 
		$allpost_query = new WP_Query($args); ?>
		<?php while ($allpost_query->have_posts()) : $allpost_query->the_post(); ?>

		<div class="banq-section6-img-d">
			<a href="<?php the_permalink(); ?>" target="_blank" class="a-cover-posa"></a>
			<!-- <img class="trend-img image-aspect" src="images/trend-img1.png" style=""> -->
			<?php the_post_thumbnail('full', array('class' => 'image-aspect trend-img')); ?>
			<img src="<?php bloginfo('template_directory'); ?>/images/trend-op.png" class="trend-img-op">
			<a href="<?php the_permalink(); ?>" target="_blank">
				<div class="banq-section6-text-d">
					<p class="Font-Open banq-section6-text-p1 color-white-text"><?php echo date_i18n(THEMEDATEFORMAT, get_the_time('U')); ?></p>
					<p class="banq-section6-text-p2 Font-Nunito color-white-text"><?php the_title(); ?>...</p>
				</div>
			</a>
		</div>
		<!-- <div class="banq-section6-img-d">
			<img class="trend-img image-aspect" src="images/trend-img2.png" style="">
			<img src="images/trend-op.png" class="trend-img-op">
			<a href="">
				<div class="banq-section6-text-d">
					<p class="Font-Open banq-section6-text-p1 color-white-text">15 July, 2017</p>
					<p class="banq-section6-text-p2 Font-Nunito color-white-text">Trendy Balloon decorations<br>tips perfect for birthday ...</p>
				</div>
			</a>
		</div>
		<div class="banq-section6-img-d">
			<img class="trend-img image-aspect" src="images/trend-img3.png" style="">
			<img src="images/trend-op.png" class="trend-img-op">
			<a href="">
				<div class="banq-section6-text-d">
					<p class="Font-Open banq-section6-text-p1 color-white-text">15 July, 2017</p>
					<p class="banq-section6-text-p2 Font-Nunito color-white-text">Latest Bollywood Moves<br>for Entry Dances...</p>
				</div>
			</a>
		</div>
		<div class="banq-section6-img-d">
			<img class="trend-img image-aspect" src="images/trend-img4.png" style="">
			<img src="images/trend-op.png" class="trend-img-op">
			<a href="">
				<div class="banq-section6-text-d">
					<p class="Font-Open banq-section6-text-p1 color-white-text">15 July, 2017</p>
					<p class="banq-section6-text-p2 Font-Nunito color-white-text">Top 10 Designer Lehengas<br>for this wedding season...</p>
				</div>
			</a>
		</div> -->
		<?php endwhile; wp_reset_query(); ?>
	</div>
	<div class="width-100 text-align-center overf">
		<a href="https://www.bandobash.com/blog" target="_blank"><button class="yellow-common-button color-yellow-back Font-Merriweather color-black-text">Read More</button></a>
	</div>
</div>

</div>	

<?php
	/* Always have wp_footer() just before the closing </body>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to reference JavaScript files.
	 */

	wp_footer();
?>
</body>
</html>