Ansico-CPT-pagecontrol/ansico-ln-plugins/templates/search.php

32 lines
1.1 KiB
PHP
Raw Normal View History

2026-04-17 20:10:27 +00:00
<?php
if (!defined('ABSPATH')) {
exit;
}
get_header();
$grouped_results = Ansico_LN_Plugins::get_grouped_search_results();
$total_results = Ansico_LN_Plugins::get_total_results_count($grouped_results);
?>
<main id="primary" class="site-main ansico-ln-search-results" style="max-width: 960px; margin: 0 auto; padding: 2rem 1rem;">
<header class="page-header" style="margin-bottom: 2rem;">
<h1 class="page-title">Søgeresultater</h1>
<p><?php echo esc_html(Ansico_LN_Plugins::get_total_results_text($total_results)); ?></p>
</header>
<?php if (!empty($grouped_results)) : ?>
<?php foreach ($grouped_results as $post_type => $group) : ?>
<section class="ansico-ln-search-group" style="margin-bottom: 2rem;">
<strong><?php echo esc_html($group['label']); ?></strong>
<?php echo Ansico_LN_Plugins::render_group_results_list($group['results']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</section>
<?php endforeach; ?>
<?php else : ?>
<p>Der blev ikke fundet nogen resultater.</p>
<?php endif; ?>
</main>
<?php
get_footer();