<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
   // Exit if accessed directly
   if (!defined('ABSPATH')) {
    exit;
}
get_header();
?>

<div class="container">
<?php if($di_data['show_bread']) { woocommerce_breadcrumb(); } 
if ($di_data['show_head_banner']) { dina_header_banner(); } ?>
<article class="row bread-row">
    <div class="col-12 alert alert-warning alert-dismissible anot" role="alert">
        <strong><span class="fal fa-bell" aria-hidden="true">
            </span> <?php _e('Page Not Found! Use the search to find the product or article you want.','dina-kala') ?></strong>
    </div>

    <div class="col-12 alert alert-light">
       <h5 style="margin-bottom:0"><span class="fal fa-info-circle" aria-hidden="true"></span> <?php _e('You might like to see the following!','dina-kala') ?></h5 style="margin-bottom:0">
    </div>
    <div class="row not-row">
    <section class="col-md-4 col-12">
        <div class="shadow-box wid-content">
            <div class="wid-title">
            <h3><?php _e('Latest Products','dina-kala') ?></h3>
            </div>
            <ul class="latest-posts">
                <?php
$posts = get_posts('orderby=date&numberposts=5&post_type=product');

foreach($posts as $post)
	{ ?>
                <li>
                    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                    <span href="#" class="post-image">
                        <?php if ( has_post_thumbnail()) :  ?>
                        <?php the_post_thumbnail( 'thumbnail' ); ?>
                        <?php else: ?>
                        <img width="64" height="64" src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/mtumb.png" alt="<?php the_title_attribute(); ?>"/>
                        <?php endif; ?>
                    </span>
                    <span class="w-post-title">
                        <?php the_title();?>
                    </span>
                    <span class="w-prod-desc">
                            <?php $product = new \WC_Product(get_the_ID()); echo $product->get_price_html(); ?>
                        </span>
                    </a>
                </li>
                <?php
	} ?>
            </ul>
        </div>
    </section>
    <section class="col-md-4 col-12">
        <div class="shadow-box wid-content">
            <div class="wid-title">
            <h3><?php _e('Random Products','dina-kala') ?></h3>
            </div>
            <ul class="latest-posts">
                <?php
$posts = get_posts('orderby=rand&numberposts=5&post_type=product');

foreach($posts as $post)
	{ ?>
                <li>
                    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                    <span href="#" class="post-image">
                        <?php if ( has_post_thumbnail()) :  ?>
                        <?php the_post_thumbnail( 'thumbnail' ); ?>
                        <?php else: ?>
                        <img width="64" height="64" src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/mtumb.png" alt="<?php the_title_attribute(); ?>"/>
                        <?php endif; ?>
                    </span>
                    <span class="w-post-title">
                        <?php the_title();?>
                    </span>
                    <span class="w-prod-desc">
                            <?php $product = new \WC_Product(get_the_ID()); echo $product->get_price_html(); ?>
                        </span>
                    </a>
                </li>
                <?php
	} ?>
            </ul>
        </div>
    </section>
    <section class="col-md-4 col-12">
        <div class="shadow-box wid-content">
            <div class="wid-title">
            <h3><?php _e('Latest Posts','dina-kala') ?></h3>
            </div>
            <ul class="latest-posts">
                <?php
$posts = get_posts('orderby=date&numberposts=5');
dfile_check();
foreach($posts as $post)
	{ ?>
                <li>
                    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                    <span href="#" class="post-image">
                        <?php if ( has_post_thumbnail()) :  ?>
                        <?php the_post_thumbnail( 'thumbnail' ); ?>
                        <?php else: ?>
                        <img width="64" height="64" src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/mtumb.png" alt="<?php the_title_attribute(); ?>"/>
                        <?php endif; ?>
                    </span>
                    <span class="w-post-title">
                        <?php the_title();?>
                    </span>
                    <span class="w-post-desc">
                            <?php echo get_jdate_publish_time(); ?>
                        </span>
                    </a>
                </li>
                <?php
	} ?>
            </ul>
        </div>
    </section>
</div>
</article>
</div>

<?php
get_footer(); ?>