

<main class="main">
    <div class="page-header text-center" style="background-image: url('/public/front/assets/images/page-header-bg.jpg')">
        <div class="container">
            <h1 class="page-title"><?= $this->Get_Lang->gl("blog", $langId) ?><span><?= $this->Get_Lang->gl("home_page", $langId) ?> / <?= $this->Get_Lang->gl("blog", $langId) ?></span></h1>
        </div><!-- End .container -->
    </div><!-- End .page-header -->
    <nav aria-label="breadcrumb" class="breadcrumb-nav mb-2">
        <div class="container">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="/"><?= $this->Get_Lang->gl("home_page", $langId) ?></a></li>
<!--                <li class="breadcrumb-item"><a href="javascript:;"><?= $this->Get_Lang->gl("blog", $langId) ?></a></li>-->
                <li class="breadcrumb-item active" aria-current="page"><?= $this->Get_Lang->gl("blog", $langId) ?></li>
            </ol>
        </div><!-- End .container -->
    </nav><!-- End .breadcrumb-nav -->

    <div class="page-content">
        <div class="container">
            <nav class="blog-nav">
                <ul class="menu-cat entry-filter justify-content-center">
                    <li class="active"><a href="javascript:;" data-filter="*"><?= $this->Get_Lang->gl("all_blog_posts", $langId) ?><span> (<?= sizeof($blog)?>) </span></a></li>
                    <?php foreach ($blogCategories as $key => $value) { 
                    $array = $this->db->query("SELECT * FROM blog WHERE categoryId = '$value->caId'")->result_object(); ?>
                    <li><a href="javascript:;" data-filter=".ca<?=$value->caId?>"><?=$value->theTitle?><span> (<?= sizeof($array)?>)</span></a></li>
                    <?php } ?>                  
                </ul>
            </nav>

            <div class="entry-container max-col-3" data-layout="fitRows">
                <?php foreach ($blog as $key => $value) { 
                    $links = $this->db->query("SELECT url FROM links WHERE page = 'blog' AND content_id = '$value->blId'")->result_object();
                   if($links){$link = '/'.$links[0]->url;}else{$link = "javascript:;";} ?>  
                <div class="entry-item ca<?=$value->categoryId?> shopping col-sm-6 col-lg-4">
                    <article class="entry entry-grid text-center">
                        <figure class="entry-media">
                            <a href="<?=$link?>">
                                <img src="<?php if(isset($value->thePhoto)) { if($value->thePhoto) { echo $value->thePhoto; } } ?>" alt="<?php if(isset($value->theTitle)) { if($value->theTitle) { echo $value->theTitle; } } ?>">
                            </a>
                        </figure>

                        <div class="entry-body">
           

                            <h2 class="entry-title">
                                <a href="<?=$link?>">
                                    <?php if(isset($value->theTitle)) { if($value->theTitle) { echo $value->theTitle; } } ?>
                                </a>
                            </h2>

                            <div class="entry-cats">
                                <a href="<?=$link?>"><?=Date("d/m/Y", strtotime($value->dateTime))?></a>                               
                            </div>

                            <div class="entry-content">
                                <p><?=strip_tags(word_limiter($value->theText,30))?></p>
                                <a href="<?=$link?>" class="read-more"><?= $this->Get_Lang->gl("Continue_Reading", $langId) ?></a>
                            </div>
                        </div>
                    </article>
                </div>

                <?php } ?>
            </div>

<!--            <nav aria-label="Page navigation">
                <ul class="pagination justify-content-center">
                    <li class="page-item disabled">
                        <a class="page-link page-link-prev" href="#" aria-label="Previous" tabindex="-1" aria-disabled="true">
                            <span aria-hidden="true"><i class="icon-long-arrow-left"></i></span>Prev
                        </a>
                    </li>
                    <li class="page-item active" aria-current="page"><a class="page-link" href="#">1</a></li>
                    <li class="page-item"><a class="page-link" href="#">2</a></li>
                    <li class="page-item">
                        <a class="page-link page-link-next" href="#" aria-label="Next">
                            Next <span aria-hidden="true"><i class="icon-long-arrow-right"></i></span>
                        </a>
                    </li>
                </ul>
            </nav>-->
        </div><!-- End .container -->
    </div><!-- End .page-content -->
</main><!-- End .main -->
<script>
    $(".menu li").removeClass("active");
    $(".menu li.blog_link").addClass("active");
</script>