Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // search.php template file
- get_header(); ?>
- <h1>Résultas de la recherche pour : <?php echo get_search_query();?></h1>
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2>
- <p><?php the_excerpt(); ?></p>
- <?php endwhile; else: ?>
- <p>Aucun résultat</p>
- <?php
- // Ajout d'une alerte email
- wp_mail( get_option('admin_email'), 'Alerte recherche sans résultats', get_search_query() );
- ?>
- <?php endif; ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment