?
Path : /home/u949514618/domains/keywordadvertisingindia.com/public_html/ |
Current File : /home/u949514618/domains/keywordadvertisingindia.com/public_html/blog.php |
<?php include "backone/db.php"; // Try fetching from cmssection $q = $conn->query("SELECT * FROM cmssection WHERE id = '4'"); if ($q->num_rows > 0) { $page = $q->fetch_assoc(); } ?> <!doctype html> <html class="no-js" lang="en-us"> <head> <meta http-equiv="content-language" content="en-us"> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title><?php echo $page['meta_title']; ?> </title> <meta name="description" content="<?php echo $page['meta_description']; ?>"> <meta name="keywords" content="<?php echo $page['keywords']; ?>"> <meta property="og:title" content="<?php echo $page['meta_title']; ?>"> <meta property="og:site_name" content="Keyword King Advertising India"> <meta property="og:url" content="https://www.keywordadvertisingindia.com/blog.php"> <meta property="og:description" content="<?php echo $page['meta_description']; ?>"> <meta property="og:type" content="website"> <meta property="og:image" content="https://keywordadvertisingindia.com/backone/uploads/<?php echo $page['image']; ?>"> <link rel="alternate" hreflang="en-us" href="https://www.keywordadvertisingindia.com/blog.php"> <link rel="canonical" href="https://www.keywordadvertisingindia.com/blog.php"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="robots" content="index, follow"> <meta name="revisit-after" content="3 days"> <!-- Place favicon.ico in the root directory --> <link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.png"> <!-- CSS here --> <link rel="stylesheet" href="assets/css/bootstrap.css"> <link rel="stylesheet" href="assets/css/meanmenu.css"> <link rel="stylesheet" href="assets/css/animate.css"> <link rel="stylesheet" href="assets/css/swiper-bundle.css"> <link rel="stylesheet" href="assets/css/magnific-popup.css"> <link rel="stylesheet" href="assets/css/nice-select.css"> <link rel="stylesheet" href="assets/css/font-awesome-pro.css"> <link rel="stylesheet" href="assets/css/flaticon.css"> <link rel="stylesheet" href="assets/css/spacing.css"> <link rel="stylesheet" href="assets/css/main.css"> <!-- Lightbox2 CSS --> <link href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.3/css/lightbox.min.css" rel="stylesheet" /> <!-- Lightbox2 JS --> <script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.3/js/lightbox.min.js"></script> </head> <body> <!--[if lte IE 9]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p> <![endif]--> <!-- back to top start --> <button class="tp-backtotop"> <span><i class="fa-thin fa-chevrons-up"></i></span> </button> <!-- back to top end --> <!-- header area start --> <?php include_once('includes/header.php'); ?> <!-- offcanvas area start --> <?php include_once('includes/offcanvas.php'); ?> <div class="body-overlay"></div> <!-- offcanvas area end --> <main> <!-- breadcrumb area start --> <section class="breadcrumb__area include-bg breadcrumb__area breadcrumb__space" data-background="backone/uploads/<?php echo $page['header_image']; ?>"> <div class="container"> <div class="row"> <div class="col-xxl-12"> <div class="breadcrumb__content text-center p-relative z-index-1"> <h3 class="breadcrumb__title">News & Blogs</h3> <div class="breadcrumb__list"> <span><a href="index.php">Home</a></span> <span class="dvdr"><i class="fa-regular fa-angle-right"></i></span> <span>Blogs</span> </div> </div> </div> </div> </div> </section> <!-- breadcrumb area end --> <!-- about area start --> <div class="tp-about__section-2 pt-40"> <div class="container"> <div class="row align-items-center"> <div class="col-lg-12"> <div class="tp-about__right-2 pl-20 mb-30 wow tpfadeLeft"> <div class="tp-section__title-wrapper"> <h3 class="mb-25"><?php echo $page['title']; ?> </h3> </div> </div> </div> </div> </div> </div> <!-- about area end --> <!-- postbox area start --> <div class="postbox__area pt-40 pb-40"> <div class="container"> <div class="row"> <div class="col-lg-8 col-12"> <div class="postbox__wrapper mr-40"> <?php $limit = 3; // posts per page $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; $start_from = ($page - 1) * $limit; $postQuery = $conn->query("SELECT * FROM blog_posts WHERE status = '1' ORDER BY created_date DESC LIMIT $start_from, $limit"); // Count total posts $total_result = $conn->query("SELECT COUNT(*) AS total FROM blog_posts WHERE status = '1'"); $total_row = $total_result->fetch_assoc(); $total_posts = $total_row['total']; $total_pages = ceil($total_posts / $limit); if ($postQuery->num_rows == 0) { echo "<p>No posts available in this category.</p>"; } else { while ($post = $postQuery->fetch_assoc()) { ?> <article class="postbox__item format-image mb-50 transition-3"> <div class="postbox__thumb w-img"> <a href="blog-detail.php?slug=<?php echo$post['slug']; ?>"> <img src="backone/uploads/<?php echo $post['featured_image']; ?>" alt="<?php echo $post['title']; ?>"> </a> </div> <div class="postbox__content"> <h3 class="postbox__title"> <a href="blog-detail.php?slug=<?php echo$post['slug']; ?>"><?php echo $post['title']; ?></a> </h3> <div class="postbox__text"> <p><?php echo substr(strip_tags($post['description']), 0, 150); ?> […]</p> </div> <div class="postbox__read-more"> <a class="tp-btn" href="blog-detail.php?slug=<?php echo$post['slug']; ?>">read more <span></span></a> </div> </div> </article> <?php } } ?> <div class="basic-pagination"> <nav> <ul> <!-- Prev --> <?php if ($page > 1): ?> <li><a href="?page=<?= $page - 1 ?>"><i class="far fa-long-arrow-left"></i></a></li> <?php endif; ?> <!-- Numbered Pages --> <?php for ($i = 1; $i <= $total_pages; $i++): ?> <?php if ($i == $page): ?> <li><span class="current"><?= $i ?></span></li> <?php else: ?> <li><a href="?page=<?= $i ?>"><?= $i ?></a></li> <?php endif; ?> <?php endfor; ?> <!-- Next --> <?php if ($page < $total_pages): ?> <li><a href="?page=<?= $page + 1 ?>"><i class="far fa-long-arrow-right"></i></a></li> <?php endif; ?> </ul> </nav> </div> </div> </div> <div class="col-lg-4 col-12"> <div class="sidebar__wrapper"> <?php $catQuery = $conn->query("SELECT c.id, c.title, c.slug, COUNT(p.id) as post_count FROM blog_categories c LEFT JOIN blog_posts p ON p.category_id = c.id AND p.status = '1' GROUP BY c.id ORDER BY c.title ASC"); echo '<div class="sidebar__widget mb-40"> <h3 class="sidebar__widget-title">Categories</h3> <div class="sidebar__widget-content"> <ul>'; while ($cat = $catQuery->fetch_assoc()) { echo '<li><a href="blog-category.php?slug=' . $cat['slug'] . '">' . $cat['title'] . '</a> <span>' . $cat['post_count'] . '</span></li>'; } echo ' </ul> </div> </div>'; ?> <div class="sidebar__widget mb-40"> <h3 class="sidebar__widget-title">pages</h3> <div class="sidebar__widget-content wd-hide-border"> <ul> <li><a href="index.php">Home</a> </li> <li><a href="page.php?slug=about-us">About Us </a></li> <li><a href="services.php">Services </a> </li> <li><a href="gallery.php">Gallery</a></li> <li><a href="blog.php">Blog</a></li> <li><a href="contact.php">Contact Us</a></li> </ul> </div> </div> <div class="sidebar__widget mb-40"> <h3 class="sidebar__widget-title">Recent Post</h3> <div class="sidebar__widget-content"> <div class="sidebar__post rc__post"> <?php $postQuery = $conn->query("SELECT * FROM blog_posts WHERE status = '1' ORDER BY created_date DESC LIMIT 3"); while ($post = $postQuery->fetch_assoc()) { ?> <div class="rc__post mb-20 d-flex align-items-center"> <div class="rc__post-thumb mr-20"> <a href="blog-detail.php?slug=<?php echo$post['slug']; ?>"><img src="backone/uploads/<?php echo $post['featured_image']; ?>" alt="<?php echo $post['title']; ?>"></a> </div> <div class="rc__post-content"> <h3 class="rc__post-title"> <a href="blog-detail.php?slug=<?php echo$post['slug']; ?>"><?php echo $post['title']; ?></a> </h3> </div> </div> <?php } ?> </div> </div> </div> </div> </div> </div> </div> </div> <!-- postbox area end --> </main> <!-- footer start --> <?php include_once('includes/footer.php'); ?> <!-- footer end --> <!-- JS here --> <script src="assets/js/vendor/jquery.js"></script> <script src="assets/js/vendor/waypoints.js"></script> <script src="assets/js/bootstrap-bundle.js"></script> <script src="assets/js/meanmenu.js"></script> <script src="assets/js/swiper-bundle.js"></script> <script src="assets/js/magnific-popup.js"></script> <script src="assets/js/parallax.js"></script> <script src="assets/js/nice-select.js"></script> <script src="assets/js/counterup.js"></script> <script src="assets/js/wow.js"></script> <script src="assets/js/isotope-pkgd.js"></script> <script src="assets/js/imagesloaded-pkgd.js"></script> <script src="assets/js/ajax-form.js"></script> <script src="assets/js/main.js"></script> </body> </html>