'No posts' missing from search.php
-
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.