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/search.php
<?php get_header('search'); ?>

<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(); ?>