Title: &#039;No posts&#039; missing from search.php
Last modified: August 21, 2016

---

# 'No posts' missing from search.php

 *  [wonderwilson](https://wordpress.org/support/users/wonderwilson/)
 * (@wonderwilson)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/no-posts-missing-from-searchphp/)
 * I’ve created a search.php file to display the search results of some custom posts
   using the loop below:
 *     ```
       <?php if ( have_posts() ) : ?>
       <?php $posts = query_posts($query_string . '&orderby=title&order=asc'); ?>
   
       <?php while ( have_posts() ) : the_post(); ?>
       <?php endwhile; ?>
       ```
   
 * I want to show some text if no posts are found, but if I add an ‘else statement
   anywhere’ I get the white screen of death. Any ideas?

The topic ‘'No posts' missing from search.php’ is closed to new replies.

## Tags

 * [search.php](https://wordpress.org/support/topic-tag/search-php/)

 * 0 replies
 * 1 participant
 * Last reply from: [wonderwilson](https://wordpress.org/support/users/wonderwilson/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/no-posts-missing-from-searchphp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
