php – WP Search page didn’t to loop my posts
I want to display the publications searched for via “searchform.php” in the “search.php” page but it does not work …
The search is done well when I look at the url (ex: New World):
But I have nothing displayed on the results page, I fall directly into the “else”.
Here is my code:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php get_template_part('content', 'search'); ?> <?php include("assets/php/posts.php"); ?> <?php endwhile; ?> <?php else : ?> ... <?php endif; ?>
Thank you in advance for your help !