Sindbad~EG File Manager
<?php
get_header();
?>
<main class="blog">
<?php
$search_query = get_search_query();
?>
<section class="blog__hero">
<div class="container">
<div class="blog__hero-container">
<div class="blog__hero-subcontainer">
<h1 class="heading-1 text-white font-bold mb-12">
Résultats de recherche pour : <?php echo esc_html($search_query); ?>
</h1>
</div>
</div>
</div>
</section>
<section class="blog__section-2 container">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 6,
'paged' => $paged,
's' => $search_query,
'order' => 'DESC',
'orderby' => 'date'
);
$query = new WP_Query($args);
?>
<div class="blog__section-2-items-container">
<?php if ($query->have_posts()): ?>
<?php while ($query->have_posts()):
$query->the_post(); ?>
<?php $category = get_the_category()[0]; ?>
<?php $post_reading_time = do_shortcode('[rt_reading_time post_id="' . get_the_ID() . '"]'); ?>
<article class="blog__section-2-item">
<a href="<?php the_permalink(); ?>" class="blog__section-2-item-container">
<div class="blog__section-2-item-image-container">
<img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="Image de l'article"
class="blog__section-2-item-image">
</div>
<div class="blog__section-2-item-content">
<div class="flex items-center justify-between">
<p class="body-1 text-purple500 mb-8 blog__section-2-category">
<?php echo esc_html($category->name); ?>
</p>
<div class="flex items-center gap-8 mb-16">
<p class="body-1 text-purple800">
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none">
<path stroke="#180835" stroke-linecap="round" stroke-linejoin="round"
d="M8.669 4v4l2.666 1.334m4-1.334A6.667 6.667 0 1 1 2.002 8a6.667 6.667 0 0 1 13.333 0Z" />
</svg>
<?php echo $post_reading_time; ?> min
</p>
</div>
</div>
<div class="blog__section-2-item-title-container mb-16">
<h4 class="blog__section-2-item-title text-purple800">
<?php the_title(); ?>
</h4>
</div>
<p class="body-1 font-regular text-purple800 mb-24">
<?php the_excerpt(); ?>
</p>
<?php if (function_exists('kk_star_ratings')): ?>
<div class="blog__section-2-rating">
<?php echo kk_star_ratings(get_the_ID()); ?>
</div>
<?php endif; ?>
</div>
</a>
</article>
<?php endwhile; ?>
<?php else: ?>
<p>Aucun article trouvé pour votre recherche.</p>
<?php endif; ?>
</div>
<!-- Pagination -->
<div class="pagination">
<?php
echo paginate_links(array(
'total' => $query->max_num_pages,
'current' => max(1, get_query_var('paged')),
'format' => '?paged=%#%',
'prev_text' => '< Précédent',
'next_text' => 'Suivant >',
));
?>
</div>
<?php wp_reset_postdata(); ?>
</section>
</main>
<?php
get_footer();
?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists