Support » Fixing WordPress » Search Results page rendering differently than rest of site.

  • Resolved jvincilione


    I’m working on a site for work and have almost everything finished, but I cannot figure out why the search results page is showing up as though the CSS is pushing it off the screen.

    I have installed the theme to a test site:

    Everything before the worpress search results php is the same as it is on page.php, index.php, etc… Same for everything after the search results code. I did not change the search results php.

    <?php get_header(); ?>
    <div id="banner">
                	<img src="<?php bloginfo('template_directory'); ?>/image/lightbulb.png" width="960" height="231" alt="Use Self-service and WIN BIG">
            	<p class="welcome">Welcome </p>
            	<?php wp_nav_menu(array('menu'=> 'Main Nav')); ?>
       		<!-- End Nav -->
        <section id="right">
                    <div class="top" align="left">	
            	<?php if (have_posts()) : ?>
                    <h2>Search Results</h2>
                    <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>
                    <?php while (have_posts()) : the_post(); ?>
                        <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                            <h2><?php the_title(); ?></h2>
                            <?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
                            <div class="entry">
                                <?php the_excerpt(); ?>
                    <?php endwhile; ?>
                    <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>
                <?php else : ?>
                    <h2>No posts found.</h2>
    	<?php endif; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael


    Forum Moderator

    the body_class() outputs the css class .search as one of the body classes of the search result page;

    you also have at least one style for .search in style.css (likely for totally different reasons);

    there is obviously a conflict.

    change the .search style to something more specific.

    Thank you for your prompt reply, I was using the search class for the search form. I changed the css to and now it is fine!

    I’m not sure if there is another conflict or not, but now one of my nav items moved to the next line.


    Thanks for you help. All is good now!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search Results page rendering differently than rest of site.’ is closed to new replies.