add this code in your search.php
<?php
$show_pagination = true;
if($wp_query->post_count < 0) {
$show_pagination = false;
}
?>
<?php if($show_pagination){ ?>
<!-- The pagination component -->
<div class="container">
<div class="row mt-3">
<?php understrap_pagination(); ?>
</div>
</div>
<?php } ?>
So your search.php look like this :
<div class="wrapper" id="search-wrapper">
<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">
<div class="row">
<main class="container" id="main">
<?php if (have_posts() && strlen( trim(get_search_query()) ) != 0 ) : while (have_posts()) : the_post(); ?>
<header class="page-header">
<div class="container">
<div class="row">
<div class="col-sm-12 text-center">
<div class="">
<h1>Zoekresultaten voor:
<?php
printf(
/* translators: %s: query term */
esc_html__( ' %s', 'understrap' ),
'<span>' . get_search_query() . '</span>'
);
?>
</h1>
</div>
</div>
</div>
</header>
<div>
<h4>
<?php /* Start the Loop */ ?>
<?php get_template_part( 'loop-templates/content', 'search' ); ?>
</h4>
</div>
<?php endwhile; else:?>
<div class="container whitespace">
<div class="row">
<div class="col-lg-12 text-center">
<p class="display-4">Geen Resultaten..</p>
</div>
</div>
</div>
<?php endif; ?>
</main>
<?php
$show_pagination = true;
if($wp_query->post_count < 0) {
$show_pagination = false;
}
?>
<?php if($show_pagination){ ?>
<!-- The pagination component -->
<div class="container">
<div class="row mt-3">
<?php understrap_pagination(); ?>
</div>
</div>
<?php } ?>
</div>
</div>
let me know if it helps you!