<?php
/*
 * Search Template File
 */
get_header(); ?>
<section class="section-main">
    <div class="breadcrumb-bg">
        <div class="container theme-container">
            <div class="site-breadcrumb">
                <div class="home-title">
                    <h2><span><?php esc_html_e('Search results for', 'legal'); echo " : " . get_search_query(); ?></span></h2>
                </div>
                <?php legal_custom_breadcrumbs(); ?>
            </div>
        </div>
    </div>
    <!--search template start-->
    <div class="container theme-container">
        <div class="page-article">
        <?php if (have_posts()) : ?>        
            <div class="row blog-page">
                <div class="col-md-9 col-sm-8">                    
                        <div class="masonry-container masonry">
                            <?php while (have_posts()): the_post(); ?>
                                <div class="col-md-6 col-sm-6 our-latest-box">
                                    <div class="latest-blog-img">
                                        <div class="inner-grid">
                                            <?php if (has_post_thumbnail()) { ?>                                                
                                                <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'large'); ?></a>
                                            <?php } else{ ?> 
                                        <a href="<?php the_permalink(); ?>"><div class="no-img fa-stack fa-lg"> <i class="fa fa-image fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x "></i> </div></a>
                                    <?php } ?>
                                            <div class="post-meta">
                                                <ul>
                                                    <?php legal_entry_meta(); ?>                  
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="latest-blog-inner">
                                            <a class="latest-blog-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                            <p><?php the_excerpt(); ?></p>
                                        </div>
                                    </div>
                                </div>
                            <?php endwhile; ?>
                        </div>
                        <div class="col-md-12 site-pagination">
                            <div class="site-pagination">
                                <ul>
                                    <?php // Previous/next page navigation.
                                    the_posts_pagination(); ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <?php get_sidebar(); ?>
                </div>
            
        <?php else : ?>
            <div class="row latest-blog-img">
                <div class="col-sm-12 search-formmain">
                    <p class="spage"><?php esc_html_e('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'legal'); ?></p>
                    <p><?php get_search_form(); ?></p>
                </div>
            </div>
        <?php endif; ?>
        </div>
    </div>
    <!--search template end-->
</section>
<?php get_footer(); ?>