internationalazing search

This commit is contained in:
Antoine M 2023-11-30 19:40:28 +01:00
parent 425270ca4c
commit d6e6b648de
2 changed files with 5 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<button type="submit">
<span>Rechercher</span>
<span><?php echo __('Rechercher', 'homegrade-theme__texte-fonctionnel') ?></span>
<img class="search_icon" src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/search-icon.svg' alt=''>
</button>
</form>

View File

@ -5,7 +5,7 @@
<div class="search-module__wrapper-container">
<?php get_search_form(); ?>
<div class="search-module__suggestions">
<>Suggestions :</>
<?php echo __("Suggestions :", "homegrade-theme__texte-fonctionnel") ?>
<?php
$args = array(
'post_type' => 'conseils',
@ -13,10 +13,11 @@
'orderby' => 'rand',
);
$suggestions_posts = get_posts($args);
$suggestions_posts = new WP_Query($args);
?>
<ul class="search-module__suggestions__navlist">
<?php foreach ($suggestions_posts as $post) : ?>
<?php foreach ($suggestions_posts->posts as $post) : ?>
<li class="suggestion-item">
<a href="<?php echo get_the_permalink($post->ID) ?>"><?php echo $post->post_title ?></a>
</li>