site_vitrine/theme/index.php

64 lines
2.2 KiB
PHP

<?php
/**
* Main Template File
*
* @package Navier_Instruments
*/
get_header();
?>
<div class="archive-header">
<div class="container">
<?php if (is_home() && !is_front_page()) : ?>
<h1 class="page-title"><?php single_post_title(); ?></h1>
<?php elseif (is_search()) : ?>
<h1 class="page-title">
<?php
printf(
/* translators: %s: search query */
esc_html__('Search Results for: %s', 'navier-instruments'),
'<span>' . get_search_query() . '</span>'
);
?>
</h1>
<?php elseif (is_archive()) : ?>
<?php the_archive_title('<h1 class="page-title">', '</h1>'); ?>
<?php the_archive_description('<div class="archive-description">', '</div>'); ?>
<?php else : ?>
<h1 class="page-title"><?php esc_html_e('Latest News', 'navier-instruments'); ?></h1>
<?php endif; ?>
</div>
</div>
<div class="container">
<?php if (have_posts()) : ?>
<div class="posts-grid">
<?php
while (have_posts()) :
the_post();
get_template_part('template-parts/content', get_post_type());
endwhile;
?>
</div>
<?php
the_posts_pagination(array(
'mid_size' => 2,
'prev_text' => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg>',
'next_text' => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg>',
));
?>
<?php else : ?>
<div class="no-results" style="padding: var(--spacing-4xl) 0; text-align: center;">
<h2><?php esc_html_e('Nothing Found', 'navier-instruments'); ?></h2>
<p><?php esc_html_e('Sorry, but nothing matched your search terms. Please try again with different keywords.', 'navier-instruments'); ?></p>
<?php get_search_form(); ?>
</div>
<?php endif; ?>
</div>
<?php
get_footer();