📁 File Manager
Editing:
/home/wedigitalindia/www/blog-details.php
<?php include("admin/connection.php"); include('include/header.php'); ?> <?php $slug = $_GET['slug']; $blogs = mysqli_query($con, "SELECT * FROM `blog` where slug='$slug'"); while ($row = mysqli_fetch_array($blogs)) { $title = $row['title']; $slug = $row['slug']; $Image = $row['Image']; $id = $row['id']; $description = $row['description']; } ?> <style> /* Default styles (Desktop first) */ h1 { font-size: 32px !important; margin-bottom: 10px; margin-top: 10px; } h2 { font-size: 28px !important; margin-bottom: 10px; margin-top: 10px; } h3 { font-size: 22px !important; margin-bottom: 10px; margin-top: 10px; } h4 { font-size: 16px !important; margin-bottom: 10px; margin-top: 10px; } /* Mobile View */ @media (max-width: 768px) { h1 { font-size: 24px !important; } h2 { font-size: 20px !important; } h3 { font-size: 16px !important; } h4 { font-size: 14px !important; } } </style> <!--Page Header Start--> <section class="page-header"> <div class="page-header__bg" style="background-image: url(<?php path() ?>assets/images/backgrounds/page-header-bg.jpg);"> </div> <div class="page-header__shape-1"> <img src="<?php path() ?>assets/images/shapes/page-header-shape-1.png" alt=""> </div> <div class="container"> <div class="page-header__inner"> <h2 style="color: white;"><?php echo htmlspecialchars($title); ?></h2> <div class="thm-breadcrumb__inner"> <ul class="thm-breadcrumb list-unstyled"> <li><a href="<?php path() ?>index.php">Home</a></li> <li><span class="fas fa-angle-right"></span></li> <li>Blog Details </li> </ul> </div> </div> </div> </section> <!--Page Header End--> <!--Blog Details Start --> <section class="blog-details"> <div class="container"> <div class="row"> <div class="col-xl-8 col-lg-7"> <?php // Fetch service details by ID (make sure $id is defined earlier) $blogs = mysqli_query($con, "SELECT * FROM `blog` WHERE id = '$id'"); if ($row = mysqli_fetch_array($blogs)) { $Image = $row['Image']; $title = $row['title']; $description = $row['description']; ?> <div class="blog-details__left"> <div class="blog-details__img-box-1"> <div class="blog-details__img"> <img src="<?php path(); ?>admin/assets/images/blog/<?php echo htmlspecialchars($Image); ?>" alt=""> </div> </div> <div class="blog-details__content"> <!-- <h3 class="blog-details__title">Essential Rules for Running a Web Agency </h3> --> <p class="blog-details__text-1"><?php echo $description; ?></p> </div> </div> <?php } ?> </div> <!--Start Sidebar--> <div class="col-xl-4 col-lg-5"> <div class="sidebar"> <!--Start Sidebar Single--> <div class="sidebar__single sidebar__category wow fadeInUp" data-wow-delay=".1s"> <div class="sidebar__title-box"> <div class="sidebar__title-shape"></div> <div class="sidebar__title-shape-2"></div> <h3 class="sidebar__title">All Blogs Post</h3> </div> <ul class="sidebar__category-list list-unstyled"> <?php // Fetch top categories $blogs = mysqli_query( $con, "SELECT slug, title FROM blog ORDER BY id DESC LIMIT 10" ); // Check if records exist if ($blogs && mysqli_num_rows($blogs) > 0) { // Current slug (for active class) $currentSlug = $_GET['slug'] ?? ''; while ($s = mysqli_fetch_assoc($blogs)) { $slug = urlencode($s['slug']); // Escape full title $fullTitle = htmlspecialchars($s['title'], ENT_QUOTES, 'UTF-8'); // Limit to 3 words $words = explode(' ', $fullTitle); if (count($words) > 3) { $limitedTitle = implode(' ', array_slice($words, 0, 3)) . '...'; } else { $limitedTitle = $fullTitle; } // Active class logic $activeClass = ($currentSlug === $s['slug']) ? 'active' : ''; ?> <li class="<?php echo $activeClass; ?>"> <a href="<?php path(); ?>blogs/<?php echo $slug; ?>"> <?php echo $limitedTitle; ?> <span class="icon-next"></span> </a> </li> <?php } } else { ?> <li>No products found</li> <?php } ?> </ul> </div> <!--End Sidebar Single--> <!-- header --> <?php $query = "SELECT * FROM `header` LIMIT 1"; $sql = mysqli_query($con, $query); $row = mysqli_fetch_assoc($sql); ?> <!-- end header --> <!--Start Sidebar Single--> <div class="sidebar__single sidebar__contact wow fadeInUp" data-wow-delay=".1s"> <div class="sidebar__contact-bg" style="background-image: url(<?php path() ?>assets/images/backgrounds/sidebar-contact-bg.jpg);"> </div> <div class="sidebar__contact-icon"> <span class="icon-phone-call"></span> </div> <div class="sidebar__contact-text"> <p>Call Us Anytime</p> <h3><a href="tel:<?php echo $row['phone']; ?>"><?php echo $row['phone']; ?></a></h3> </div> <div class="sidebar__contact-btn"> <a class="thm-btn" href="tel:<?php echo $row['phone']; ?>">Let's Talk <span></span> <span></span> <span></span> <span></span> <span></span> </a> </div> </div> <!--End Sidebar Single--> </div> </div> <!--End Sidebar--> </div> </div> </section> <!--Blog Details End--> <?php include("include/footer.php"); ?>
Save
Cancel