📁 File Manager
Editing:
/home/wedigitalindia/public_html/bartozmarketing.com/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="container"> <div class="page-header__inner"> <h3><?php echo htmlspecialchars($title); ?></h3> <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 blog-details__left-sidebar"> <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"> <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"> <h3 class="sidebar__title">All Post Blog</h3> <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--> </div> </div> <!--End Sidebar--> </div> </div> </section> <!--Blog Details Start--> <?php include("include/footer.php"); ?>
Save
Cancel