Forums

White search page (5 posts)

  1. 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.

  2. TM3909
    Member
    Posted 1 year ago #

    I think the first line should be:

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

    is that the full code of search.php, or does it have a 'get_header();' somewhere?

    link to your site?

  4. 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/

  5. alchymyth
    The Sweeper
    Posted 1 year ago #

    got it fixed?

    it is showing results now.

    (or a 'no post found' message)

Topic Closed

This topic has been closed to new replies.

About this Topic