Title: Search.php problem; blank page
Last modified: August 19, 2016

---

# Search.php problem; blank page

 *  [stijlvollemannen](https://wordpress.org/support/users/stijlvollemannen/)
 * (@stijlvollemannen)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/)
 * I didn’t change anything to the code, except for some translations… However the
   search isn’t working and I have no idea what the issue is.
 * Can anyone help?
 * My website: [http://stijlvollemannen.nl](http://stijlvollemannen.nl)
 *     ```
       <?php require(TEMPLATEPATH . '/content-before.php'); ?>
   
           <div id="content">
   
               <?php $theme->hook('content_before'); ?>
   
           	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                       <h2 class="generic"><?php _e( 'Zoekresultaten voor:', 'flexithemes' ); ?> <?php echo get_search_query(); ?></h2>
                       <?php
                       $layout_options_prefix = 'search';
                       require(TEMPLATEPATH . '/loop.php');
                   }  else {
                       ?>
                       <h2 class="generic"><?php _e( 'Niets gevonden', 'flexithemes' ); ?></h2>
                       <div class="entry">
                           <?php printf( __( 'Sorry, je zoekopdracht gaf geen resultaat: %s. Probeer het opnieuw met een andere zoekopdracht.', 'flexithemes' ), '<strong>' . get_search_query() . '</strong>' ); ?>
                       </div>
                       <div id="searchwrap">
                           <?php get_search_form(); ?>
                       </div>
                       <?php
                   }
               ?>
   
               <?php $theme->hook('content_after'); ?>
   
           </div> <!--/content--> 
   
       <?php require(TEMPLATEPATH . '/content-after.php'); ?>
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [dremeda](https://wordpress.org/support/users/dremeda/)
 * (@dremeda)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/#post-1835447)
 * Hi,
 * Do you have a searchform.php in your theme?
 *  Thread Starter [stijlvollemannen](https://wordpress.org/support/users/stijlvollemannen/)
 * (@stijlvollemannen)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/#post-1835450)
 * Yes, I do…
 *     ```
       <?php $search_text = empty($_GET['s']) ? __('Zoeken') : get_search_query(); ?>
       <div id="search">
           <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
               <input type="text" value="<?php echo $search_text; ?>"
                   name="s" id="s"  onblur="if (this.value == '')  {this.value = '<?php echo $search_text; ?>';}"
                   onfocus="if (this.value == '<?php echo $search_text; ?>') {this.value = '';}" />
               <input type="image" src="<?php bloginfo('template_url'); ?>/images/search.png" title="<?php _e('Search'); ?>" class="search-image" />
           </form>
       </div>
       ```
   
 *  Thread Starter [stijlvollemannen](https://wordpress.org/support/users/stijlvollemannen/)
 * (@stijlvollemannen)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/#post-1835452)
 * Totally clueless what to do here….
 *  Thread Starter [stijlvollemannen](https://wordpress.org/support/users/stijlvollemannen/)
 * (@stijlvollemannen)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/#post-1835731)
 * I’ve deactivated All Categories SEO and this gave an error when searching;
 * Parse error: syntax error, unexpected ‘}’ in /home/content/03/7140503/html/wp-
   content/themes/Vega/search.php on line 12
 * This is the code for search.php; what to do where?
 *     ```
       <?php require(TEMPLATEPATH . '/content-before.php'); ?>
   
           <div id="content">
   
               <?php $theme->hook('content_before'); ?>
   
           	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                       <h2 class="generic"><?php _e( 'Zoekresultaten voor:', 'flexithemes' ); ?> <?php echo get_search_query(); ?></h2>
                       <?php
                       $layout_options_prefix = 'search';
                       require(TEMPLATEPATH . '/loop.php');
                   }  else {
                       ?>
                       <h2 class="generic"><?php _e( 'Niets gevonden', 'flexithemes' ); ?></h2>
                       <div class="entry">
                           <?php printf( __( 'Sorry, je zoekopdracht gaf geen resultaat: %s. Probeer het opnieuw met een andere zoekopdracht.', 'flexithemes' ), '<strong>' . get_search_query() . '</strong>' ); ?>
                       </div>
                       <div id="searchwrap">
                           <?php get_search_form(); ?>
                       </div>
                       <?php
                   }
               ?>
   
               <?php $theme->hook('content_after'); ?>
   
           </div> <!--/content--> 
   
       <?php require(TEMPLATEPATH . '/content-after.php'); ?>
       ```
   
 *  [Cirkut](https://wordpress.org/support/users/cirkut/)
 * (@cirkut)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/#post-1835854)
 * I know this is a late answer, but your loop involves a colon and brackets, which
   do not mix. After `while ( have_posts() )`, you should use a `{` instead of a
   colon. The code should then stop producing an error.
 * I post this in case anyone else stumbles upon this question like I did.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Search.php problem; blank page’ is closed to new replies.

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [Cirkut](https://wordpress.org/support/users/cirkut/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/searchphp-problem-blank-page/#post-1835854)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
