| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/successkpi/wp-content/themes/successkpi/ |
Upload File : |
<?php
/**
* search fuctionality
*/
get_header(); ?>
<section class="our-resources-blog search-page spacing">
<div class="container">
<?php
$s = get_search_query();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$argsSearch = array(
's' => $s,
'paged' => $paged,
'post_type' => array('press','webinars','events','page','videos','guides','reports','post','success-stories'),
'post_status' => 'publish',
);
$the_query = new WP_Query($argsSearch);
$total = $the_query->found_posts;
_e("<h3 class='search-heading'>" . $total . " Search Results Found For : ' " . esc_attr(get_query_var('s')) . " '</h3>");
?>
<div class="row <?php echo $total ? '' : 'justify-content-center' ?>">
<?php if ($the_query->have_posts()) :
while ($the_query->have_posts()) : $the_query->the_post();
$id = get_the_id();
$excerpt = has_excerpt($id) ? get_post_field('post_excerpt', $id) : get_field('short_description', $id);
$excerpt = $excerpt ?: wp_strip_all_tags(get_the_content(null, false, $id));
$excerpt = wp_trim_words($excerpt, 30, '...');
?>
<div class="col-12">
<div class="practices-card">
<a href="<?php the_permalink(); ?>">
<div class="card-body">
<h4 class="card-heading color-dark-grey"><?= esc_html(get_the_title()) ?></h4>
<p class="card-text card-subheading color-grey"><?= $excerpt ?></p>
</div>
</a>
</div>
</div>
<?php
endwhile;
else :
?>
<div class="alert alert-info">
<p>Sorry, but nothing matched your search criteria. Please try again with some different
keywords.</p>
</div>
<?php
endif;
?>
<!-- Pagination -->
<?php
$current_page = max(1, get_query_var('paged'));
$pagination_links = paginate_links(array(
'base' => add_query_arg('paged', '%#%'),
'format' => '',
'current' => $current_page,
'total' => $the_query->max_num_pages,
'prev_text' => '<span>Prev</span>',
'next_text' => '<span>Next</span>',
'mid_size' => wp_is_mobile() ? 0 : 2,
'end_size' => wp_is_mobile() ? 0 : 2,
'type' => 'plain',
));
if ($pagination_links) :
?>
<div class="col-12">
<div class="pagination text-right">
<div class="pagination-wrapper">
<?php echo wp_kses_post($pagination_links); ?>
</div>
</div>
</div>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<!-- Pagination Ends -->
</div>
</div>
</section>
<?php get_footer(); ?>