HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User: root (0)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /var/www/healthnettoday.com/wp-content/themes/healthnettoday/home.php
<?php
/*
** Template Name: Home
*/ 
get_header(); ?>
<!-- banner area -->
    <section class="slider-sec">
      <div class="slider-container">
        <button class="slider-arrow left" id="left-arrow">&#8592;</button>
        <div class="slider">
          <div class="slider-item"> 
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Building Resilience After Trauma.jpg" alt="Leo">
            <p>Today: You need to get out there and socialize...</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/begenire-guide.jpg" alt="Aquabats">
            <p>Events Near You: The Aquabats!</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Boost Your Mood.jpg" alt="AI Chat">
            <p>AI Chat: What habit could improve my week?</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Depressive Disorders.jpg" alt="Watch">
            <p>What to Watch: Happy Gilmore 2</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Building Resilience After Trauma.jpg" alt="History">
            <p>Today in History: 'Animal House' hits theaters</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Building Resilience After Trauma.jpg" alt="Play Creators">
            <p>Play Creators: 275K plays</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/begenire-guide.jpg" alt="Aquabats">
            <p>Events Near You: The Aquabats!</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Boost Your Mood.jpg" alt="AI Chat">
            <p>AI Chat: What habit could improve my week?</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Depressive Disorders.jpg" alt="Watch">
            <p>What to Watch: Happy Gilmore 2</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Building Resilience After Trauma.jpg" alt="History">
            <p>Today in History: 'Animal House' hits theaters</p>
          </div>
          <div class="slider-item">
            <img src="<?php echo bloginfo('template_directory'); ?>/image/Building Resilience After Trauma.jpg" alt="Play Creators">
            <p>Play Creators: 275K plays</p>
          </div>
        </div>
        <button class="slider-arrow right" id="right-arrow">&#8594;</button>
      </div>
  </section>
  
  
      <section class="banner-sec">
        <div class="container">
            <div class="banner-main-div">
                <div id="carouselExample" class="carousel slide">
                    <div class="carousel-inner">
                        <?php if(have_rows('slider_section')):while(have_rows('slider_section')):the_row(); ?>
                      <div class="carousel-item active" style="background-image: url('<?php echo get_sub_field('slider_img'); ?>');background-size: cover; background-repeat: no-repeat; background-position: 100%; padding: 100px 0px;">
                        <div class="home-banner-title">
                            <h1>Home of Holistic Health</h1>
                        </div>
                        <div class="search-container mb-5">
                             <div class="search-box mt-3">
                                  <form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
                                    <div class="search-inner social-box align-items-center">
                                      <input type="search" class="search-field" name="s" placeholder="Search here..." value="<?php echo get_search_query(); ?>" />
                                      <input type="hidden" name="post_type" value="threads" />
                                      <button type="submit" class="search-btn">Search</button>
                                    </div>
                                  </form>
                                
                                  <!-- Auto results will appear here -->
                                  <div class="auto-search-results"></div>
                                </div>
                           <?php //echo do_shortcode('[ivory-search id="10" title="AJAX Search Form"]'); ?>
                          </div>
                          <div class="social-links-main">
                            <div class="container">
                                <div class="d-flex justify-content-center ">
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fab fa-ebay"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fas fa-envelope"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fas fa-store"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fas fa-book"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fab fa-youtube"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fab fa-facebook"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fab fa-whatsapp"></i>
                                        </a>
                                    </div>
                                    <div class="col-box mx-3">
                                        <a href="">
                                            <i class="fab fa-linkedin"></i>
                                        </a>
                                    </div>
                                </div>
                            </div>
                          </div>
                      </div>
                      <!--<div class="carousel-item" style="background-image: url('<?php echo bloginfo('template_directory'); ?>/image/bnr-bg-2.jpg');background-size: cover; background-repeat: no-repeat; background-position: 100%; padding: 100px 0px;">-->
                      <!--  <div class="search-container">-->
                      <!--      <?php echo do_shortcode('[ivory-search id="10" title="AJAX Search Form"]'); ?>-->
                      <!--    </div>-->
                      <!--    <div class="social-links-main">-->
                      <!--      <div class="container">-->
                      <!--          <div class="d-flex justify-content-center ">-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fab fa-ebay"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fas fa-envelope"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fas fa-store"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fas fa-book"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fab fa-youtube"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fab fa-facebook"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fab fa-whatsapp"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--              <div class="col-box mx-3">-->
                      <!--                  <a href="">-->
                      <!--                      <i class="fab fa-linkedin"></i>-->
                      <!--                  </a>-->
                      <!--              </div>-->
                      <!--          </div>-->
                      <!--      </div>-->
                      <!--    </div>-->
                      <!--</div>-->
                      <?php endwhile; endif; wp_reset_query(); ?>
                    </div>
                    <button class="carousel-control-prev" type="button" data-bs-target="#carouselExample" data-bs-slide="prev">
                      <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                      <span class="visually-hidden">Previous</span>
                    </button>
                    <button class="carousel-control-next" type="button" data-bs-target="#carouselExample" data-bs-slide="next">
                      <span class="carousel-control-next-icon" aria-hidden="true"></span>
                      <span class="visually-hidden">Next</span>
                    </button>
                  </div>
            </div>
        </div>
      </section>

      
<div class="swiper myVideoSlider">
        <div class="swiper-wrapper">
      
             <?php if( have_rows('videos') ): ?>
    <?php while( have_rows('videos') ): the_row(); ?>
        <?php 
        $video_image = get_sub_field('video_image'); // ACF image field
        $video_link  = get_sub_field('video_link');  // ACF video URL
        $video_text = get_sub_field('video_text');  // ACF video URL
        ?>
        <div class="swiper-slide video-car">
                <a data-fancybox="video-gallery" data-src="<?php echo esc_url($video_link); ?>">
                    <?php if( $video_image ): ?>
                        <img src="<?php echo esc_url($video_image['url']); ?>" alt="<?php echo esc_attr($video_image['alt']); ?>" />
                    <?php else: ?>
                        <img src="<?php echo get_template_directory_uri(); ?>/images/fallback.jpg" alt="Fallback Image" />
                    <?php endif; ?>
                    <i class="fa-solid fa-circle-play"></i>
                </a>
                <h4><?php echo esc_html( $video_text ); ?></h4>
        </div>
    <?php endwhile; ?>
<?php else: ?>
    <p>No videos found.</p>
<?php endif; ?>

      
        </div>
      
        <!-- Navigation arrows -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
      
      </div>
     <!-- main-1 area -->
      
     <section class="main-1-sec sec-cmn-pad">
        <div class="container">
            <div class="row">
                <div class="col-lg-6">
                    <div class="main-1-slide">
                        <div class="main-1-parent-slide">
                            <div class="main-1-img-box">
                                <img src="<?php echo bloginfo('template_directory'); ?>/image/main-1-bg.jpg" alt="">
                            </div>
                            <div class="main-1-text-box mt-3">
                                <a href=""><h2>Men's health</h2></a>
                                <p>Highlights gender-specific health issues such as reproductive health</p>
                            </div>
                        </div>

                        <div class="main-1-parent-slide">
                            <div class="main-1-img-box">
                                <img src="<?php echo bloginfo('template_directory'); ?>/image/main-1-bg.jpg" alt="">
                            </div>
                            <div class="main-1-text-box mt-3">
                                <h2>Men's health</h2>
                                <p>Highlights gender-specific health issues such as reproductive health</p>
                            </div>
                        </div>

                        <div class="main-1-parent-slide">
                            <div class="main-1-img-box mt-3">
                                <img src="<?php echo bloginfo('template_directory'); ?>/image/main-1-bg.jpg" alt="">
                            </div>
                            <div class="main-1-text-box">
                                <h2>Men's health</h2>
                                <p>Highlights gender-specific health issues such as reproductive health</p>
                            </div>
                        </div>
                        
                    </div>
                </div>
                <div class="col-lg-3">
                    <h2>Weather</h2>
                    <div class="news-ad-div">
                        <?php echo do_shortcode('[weather_forecast_ny]'); ?>
                    </div>
                </div>
                <div class="col-lg-3">
                     <h2>Trending Now</h2>
                    <div class="story-sec-ad-div">
                        <?php echo do_shortcode('[trend_box]'); ?>
                         <?php //echo do_shortcode('[twitter_feed_id user_id="31187736" count="2"]'); ?>
                    </div>
                </div>
            </div>
        </div>
     </section>



        <!-- last-slider area -->

        <section class="last-sec sec-btm-pad">
            <div class="container">
                <div class="last-top-div text-center mb-5">
                    <h1>Health Topics Overview</h1>
                </div>
                <?php

                $args = array(
                    'post_type'      => 'post',        
                    'post_status'    => 'publish',     
                    'category_name'  => 'health-topics', 
                    'posts_per_page' => 8,            
                    'orderby'        => 'date',        
                    'order'          => 'DESC',
                    'ignore_sticky_posts' => true,
                );
                
                // Create a new WP_Query instance
                $health_query = new WP_Query( $args );

// Check if there are any posts to display
if ( $health_query->have_posts() ) {
    ?>
    <div class="last-slider-parent">
    <?php
    // Start the loop
    while ( $health_query->have_posts() ) {
        $health_query->the_post(); // Setup post data for the current post
        
        // Get the post URL
        $post_link = get_permalink();
        
        // Get the post title
        $post_title = get_the_title();
        
        // Get a trimmed excerpt (25 words max)
        $post_excerpt = wp_trim_words( get_the_excerpt(), 25 );
        
        // Get the featured image (or a placeholder if none exists)
        $image_html = '';
        if ( has_post_thumbnail() ) {
            // Get the featured image, using a custom size if defined (e.g., 'medium')
            $image_html = get_the_post_thumbnail( get_the_ID(), 'medium' ); 
        } else {
            // Placeholder/Fallback image (Modify this to use your own template image path if needed)
            // Note: In a live environment, you should use a proper placeholder image path.
            $fallback_url = get_template_directory_uri() . '/image/default-health.jpg';
            $image_html = '<img src="' . esc_url($fallback_url) . '" alt="' . esc_attr($post_title) . '">';
        }
        
        ?>
        <div class="last-slider-parent-box">
            <div class="last-slider-img-box">
                <?php echo $image_html; // Output the image or placeholder ?>
            </div>
            <div class="last-slider-text-box mt-3">
                <h2><a href="<?php echo esc_url($post_link); ?>"><?php echo esc_html($post_title); ?></a></h2>
                <p><?php echo esc_html($post_excerpt); ?></p>
                <a href="<?php echo esc_url($post_link); ?>" class="cmn-btn">Read More</a>
            </div>
        </div>
        <?php
    }
    ?>
    </div>
    <?php
    
    // Restore original Post Data
    wp_reset_postdata();

} else {
    // If no posts are found in the category
    echo '<p>No health topics posts found.</p>';
}
?>
                <!--<div class="last-slider-parent">-->
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/Top Health Sites.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Top Health Sites</h2>-->
                <!--            <p>Top health sites offer a wealth of information and resources for individuals seeking reliable health information...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/LiveWell.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>LiveWell</h2>-->
                <!--            <p>LiveWell emphasizes overall wellness, focusing on physical, mental, and emotional well-being. This concept...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/Mental Health.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Mental Health</h2>-->
                <!--            <p>Mental health is an essential component of overall well-being, affecting how individuals think, feel, and act...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/global-health.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Global Health</h2>-->
                <!--            <p>Global health focuses on the health and well-being of people worldwide, addressing issues such as access...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/Sexual Health.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Sexual Health</h2>-->
                <!--            <p>Sexual health covers a range of topics related to sexual activity, reproductive health, and emotional intimacy...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/Pregnancy.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Pregnancy</h2>-->
                <!--            <p>Pregnancy is a pivotal time for expecting mothers and their families, requiring both physical and emotional care...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/Infectious Disease.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Infectious Disease</h2>-->
                <!--            <p>Infectious diseases remain a major global health concern, with pathogens like bacteria, viruses, and fungi causing...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--    <div class="last-slider-parent-box">-->
                <!--        <div class="last-slider-img-box">-->
                <!--            <img src="<?php echo bloginfo('template_directory'); ?>/image/Trending Health.jpg" alt="">-->
                <!--        </div>-->
                <!--        <div class="last-slider-text-box mt-3">-->
                <!--            <h2>Trending Health</h2>-->
                <!--            <p>Trending health refers to the latest discussions and developments in the health and wellness space, often driven...</p>-->
                <!--            <a href="" class="cmn-btn">Read More</a>-->
                <!--        </div>-->
                <!--    </div>-->
    
                <!--</div>-->
            </div>
         </section>
    

    <!-- main-2 area -->

    <section class="main-2-sec sec-btm-pad">
        <div class="container">
    
            <!-- health a-z -->
            <div class="main-2-top-div">
                <h1>Health A–Z</h1>
            </div>
            
                <div class="row g-4 mt-3">
                  <?php
                    // Query posts from the "Health A–Z" category
                    $args = array(
                      'category_name' => 'health-a-z', // use the category slug
                      'posts_per_page' => 6, // number of posts to display
                      'post_status' => 'publish'
                    );
                    $health_posts = new WP_Query($args);
            
                    if ($health_posts->have_posts()):
                      while ($health_posts->have_posts()): $health_posts->the_post();
                  ?>
                    <div class="col-lg-4 col-md-6">
                      <div class="main-2-img-box">
                        <a href="<?php the_permalink(); ?>">
                          <?php if (has_post_thumbnail()) {
                            the_post_thumbnail('medium_large', array('alt' => get_the_title()));
                          } else { ?>
                            <img src="<?php echo get_template_directory_uri(); ?>/image/default-thumb.jpg" alt="<?php the_title(); ?>">
                          <?php } ?>
                        </a>
                      </div>
                    </div>
            
                    <div class="col-lg-5 col-md-6">
                      <div class="main-2-text-box">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        <p><?php echo wp_trim_words(get_the_excerpt(), 30, '...'); ?></p>
                      </div>
                    </div>
            
                    <div class="col-lg-3 d-none d-lg-block">
                      <div class="main-1-ad">
                        <!-- Optional ad or widget area -->
                      </div>
                    </div>
            
                  <?php
                      endwhile;
                      wp_reset_postdata();
                    else:
                  ?>
                    <div class="col-12 text-center">
                      <p>No posts found in the Health A–Z category.</p>
                    </div>
                  <?php endif; ?>
                </div>
            <!-- Lifestyle & Wellness -->
            <div class="main-2-top-div mt-5">
                <h1>Lifestyle & Wellness</h1>
            </div>
            <div class="row g-4 mt-3">
                  <?php
                    // Query posts from the "Health A–Z" category
                    $args = array(
                      'category_name' => 'lifestyle-wellness', // use the category slug
                      'posts_per_page' => 6, // number of posts to display
                      'post_status' => 'publish'
                    );
                    $health_posts = new WP_Query($args);
            
                    if ($health_posts->have_posts()):
                      while ($health_posts->have_posts()): $health_posts->the_post();
                  ?>
                    <div class="col-lg-4 col-md-6">
                      <div class="main-2-img-box">
                        <a href="<?php the_permalink(); ?>">
                          <?php if (has_post_thumbnail()) {
                            the_post_thumbnail('medium_large', array('alt' => get_the_title()));
                          } else { ?>
                            <img src="<?php echo get_template_directory_uri(); ?>/image/default-thumb.jpg" alt="<?php the_title(); ?>">
                          <?php } ?>
                        </a>
                      </div>
                    </div>
            
                    <div class="col-lg-5 col-md-6">
                      <div class="main-2-text-box">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        <p><?php echo wp_trim_words(get_the_excerpt(), 30, '...'); ?></p>
                      </div>
                    </div>
            
                    <div class="col-lg-3 d-none d-lg-block">
                      <div class="main-1-ad">
                        <!-- Optional ad or widget area -->
                      </div>
                    </div>
            
                  <?php
                      endwhile;
                      wp_reset_postdata();
                    else:
                  ?>
                    <div class="col-12 text-center">
                      <p>No posts found in the Health A–Z category.</p>
                    </div>
                  <?php endif; ?>
                </div>
    
            <!-- Herbs & Dietary Supplements -->
            <div class="main-2-top-div mt-5">
                <h1>Herbs & Dietary Supplements</h1>
            </div>
            <div class="row g-4 mt-3">
                  <?php
                    // Query posts from the "Health A–Z" category
                    $args = array(
                      'category_name' => 'herbs-dietary-supplements', // use the category slug
                      'posts_per_page' => 6, // number of posts to display
                      'post_status' => 'publish'
                    );
                    $health_posts = new WP_Query($args);
            
                    if ($health_posts->have_posts()):
                      while ($health_posts->have_posts()): $health_posts->the_post();
                  ?>
                    <div class="col-lg-4 col-md-6">
                      <div class="main-2-img-box">
                        <a href="<?php the_permalink(); ?>">
                          <?php if (has_post_thumbnail()) {
                            the_post_thumbnail('medium_large', array('alt' => get_the_title()));
                          } else { ?>
                            <img src="<?php echo get_template_directory_uri(); ?>/image/default-thumb.jpg" alt="<?php the_title(); ?>">
                          <?php } ?>
                        </a>
                      </div>
                    </div>
            
                    <div class="col-lg-5 col-md-6">
                      <div class="main-2-text-box">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        <p><?php echo wp_trim_words(get_the_excerpt(), 30, '...'); ?></p>
                      </div>
                    </div>
            
                    <div class="col-lg-3 d-none d-lg-block">
                      <div class="main-1-ad">
                        <!-- Optional ad or widget area -->
                      </div>
                    </div>
            
                  <?php
                      endwhile;
                      wp_reset_postdata();
                    else:
                  ?>
                    <div class="col-12 text-center">
                      <p>No posts found in the Health A–Z category.</p>
                    </div>
                  <?php endif; ?>
                </div>
    
            <!-- Medication A–Z -->
            <div class="main-2-top-div mt-5">
                <h1>Medication A–Z</h1>
            </div>
            <div class="row g-4 mt-3">
                  <?php
                    // Query posts from the "Health A–Z" category
                    $args = array(
                      'category_name' => 'medication-a-z', // use the category slug
                      'posts_per_page' => 6, // number of posts to display
                      'post_status' => 'publish'
                    );
                    $health_posts = new WP_Query($args);
            
                    if ($health_posts->have_posts()):
                      while ($health_posts->have_posts()): $health_posts->the_post();
                  ?>
                    <div class="col-lg-4 col-md-6">
                      <div class="main-2-img-box">
                        <a href="<?php the_permalink(); ?>">
                          <?php if (has_post_thumbnail()) {
                            the_post_thumbnail('medium_large', array('alt' => get_the_title()));
                          } else { ?>
                            <img src="<?php echo get_template_directory_uri(); ?>/image/default-thumb.jpg" alt="<?php the_title(); ?>">
                          <?php } ?>
                        </a>
                      </div>
                    </div>
            
                    <div class="col-lg-5 col-md-6">
                      <div class="main-2-text-box">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        <p><?php echo wp_trim_words(get_the_excerpt(), 30, '...'); ?></p>
                      </div>
                    </div>
            
                    <div class="col-lg-3 d-none d-lg-block">
                      <div class="main-1-ad">
                        <!-- Optional ad or widget area -->
                      </div>
                    </div>
            
                  <?php
                      endwhile;
                      wp_reset_postdata();
                    else:
                  ?>
                    <div class="col-12 text-center">
                      <p>No posts found in the Health A–Z category.</p>
                    </div>
                  <?php endif; ?>
                </div>



            <!-- Trending  News -->
            <div class="main-2-top-div mt-5">
                <h1>Trending  News</h1>
            </div>
            <div class="row g-4 mt-3">
                  <?php
                    // Query posts from the "Health A–Z" category
                    $args = array(
                      'category_name' => 'trending-news', // use the category slug
                      'posts_per_page' => 6, // number of posts to display
                      'post_status' => 'publish'
                    );
                    $health_posts = new WP_Query($args);
            
                    if ($health_posts->have_posts()):
                      while ($health_posts->have_posts()): $health_posts->the_post();
                  ?>
                    <div class="col-lg-4 col-md-6">
                      <div class="main-2-img-box">
                        <a href="<?php the_permalink(); ?>">
                          <?php if (has_post_thumbnail()) {
                            the_post_thumbnail('medium_large', array('alt' => get_the_title()));
                          } else { ?>
                            <img src="<?php echo get_template_directory_uri(); ?>/image/default-thumb.jpg" alt="<?php the_title(); ?>">
                          <?php } ?>
                        </a>
                      </div>
                    </div>
            
                    <div class="col-lg-5 col-md-6">
                      <div class="main-2-text-box">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        <p><?php echo wp_trim_words(get_the_excerpt(), 30, '...'); ?></p>
                      </div>
                    </div>
            
                    <div class="col-lg-3 d-none d-lg-block">
                      <div class="main-1-ad">
                        <!-- Optional ad or widget area -->
                      </div>
                    </div>
            
                  <?php
                      endwhile;
                      wp_reset_postdata();
                    else:
                  ?>
                    <div class="col-12 text-center">
                      <p>No posts found in the Health A–Z category.</p>
                    </div>
                  <?php endif; ?>
                </div>
    
            <!-- Continue this pattern for the rest of your content sections -->
    
        </div>
    </section>
<?php get_footer();?>