Pim Willems
Member
Posted 1 year ago #
Dear readers,
I'll get a white page when i search for something on my wordpress blog. The code on the search page is:
<?php if ( have_posts() ) : ?>
<div id="pagetitle" >
<p>Search Results</p>
</div>
</div>
<div id="i24titleline" ></div>
<div id="widgettext">
<?php get_sidebar(); ?>
</div>
<div id="contenttext" >
<span class="font-weight:20px;'"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '' . get_search_query() . '' ); ?></span>
<?php
/* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called loop-search.php and that will be used instead.
*/
get_template_part( 'loop', 'search' ); ?>
<?php else : ?>
<span class="font-weight:20px;'"><?php _e( 'Nothing Found', 'twentyten' ); ?></span>
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div>
<?php endwhile; ?>
Why am I getting a white page?
Please help.
I think the first line should be:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
is that the full code of search.php, or does it have a 'get_header();' somewhere?
link to your site?
Pim Willems
Member
Posted 1 year ago #
The full search.php is like this:
<?php get_header(); ?>
<div id="contentbackground" >
<div id="slider" ></div>
<div id="container2" >
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="pagetitle" >
<p>Search Results</p>
</div>
</div>
<div id="i24titleline" ></div>
<div id="widgettext">
<?php get_sidebar(); ?>
</div>
<div id="contenttext" >
<span class="font-weight:20px;'"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '' . get_search_query() . '' ); ?></span>
<?php
/* Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file
* called loop-search.php and that will be used instead.
*/
get_template_part( 'loop', 'search' ); ?>
<?php else : ?>
<span class="font-weight:20px;'"><?php _e( 'Nothing Found', 'twentyten' ); ?></span>
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div>
<?php endwhile; ?>
</div>
<?php get_footer(); ?>
You can visit the site on http://pimwillems.com/acc/
got it fixed?
it is showing results now.
(or a 'no post found' message)