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/americahealthline.com/wp-content/themes/americahealthhaven/search.php
<?php
get_header(); ?>
<!-- banner area start -->
<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/Anxiety Disorders.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="row">
                <div class="banner-main-div" style="background:url('<?php echo bloginfo('template_directory'); ?>/image/about-landing-banner.png');background-repeat: no-repeat;
    object-fit: cover;background-position: center;">
                   <!--<h1>Home of Trusted Health Information</h1>-->
                   <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>
        </div>
    </section>


<section class="featured-threads sec-cmn-pad <?php echo esc_attr( $gender_class ?? '' ); ?>">

    <h2 class="section-title text-center mb-5">
        Search Results for:
        <span><?php echo esc_html( get_search_query() ); ?></span>
    </h2>
<div class="container">
    <div class="row justify-content-center">
        <div class="col-lg-10">
<div class="row">
        <?php
        $search_term = get_search_query();

        $args = array(
            'post_type'      => 'post',
            'posts_per_page' => -1,
            's'              => $search_term,
            'orderby'        => 'relevance',
            'order'          => 'DESC',
        );

        $threads = new WP_Query( $args );

        if ( $threads->have_posts() ) :
            while ( $threads->have_posts() ) : $threads->the_post();

                $threads_icon    = get_field( 'threads_icon' );
                $content_raw     = apply_filters( 'the_content', get_the_content() );
                $trimmed_content = wp_trim_words( wp_strip_all_tags( $content_raw ), 10, '...' );
                ?>

                <div class="thread-card col-md-4 threadcardss">
                    
                    <!-- Icon -->
                    <div class="icon-circle">
                        <?php if ( is_array( $threads_icon ) && isset( $threads_icon['url'] ) ) : ?>
                            <img src="<?php echo esc_url( $threads_icon['url'] ); ?>" alt="<?php echo esc_attr( $threads_icon['alt'] ); ?>">
                        <?php elseif ( is_string( $threads_icon ) ) : ?>
                            <i class="fas <?php echo esc_attr( $threads_icon ); ?>"></i>
                        <?php else : ?>
                            <i class="fas fa-circle"></i>
                        <?php endif; ?>
                    </div>

                    <!-- Title -->
                    <a href="<?php the_permalink(); ?>">
                        <h3><?php the_title(); ?></h3>
                    </a>

                    <!-- Trimmed content -->
                    <p><?php echo esc_html( $trimmed_content ); ?></p>

                </div>

            <?php
            endwhile;
            wp_reset_postdata();
        else :
            ?>

            <!-- NO RESULTS -->
            <div class="no-results text-center">
                <h3>No search results found 😔</h3>
                <p>
                    We couldn’t find any matching
                    <strong><?php echo esc_html( $search_term ); ?></strong>.
                </p>
                <p>Try different keywords.</p>

                <?php //get_search_form(); ?>
            </div>

        <?php endif; ?>
        </div>
</div>
    </div>
</div>
</section>

<?php get_footer(); ?>