The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Search Results page rendering differently than rest of site. (4 posts)

  1. jvincilione
    Posted 3 years ago #

    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: lucienconsulting.com/greystone/

    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(); ?>
  2. Michael
    Forum Moderator
    Posted 3 years ago #

    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.


  3. jvincilione
    Posted 3 years ago #

    Thank you for your prompt reply, I was using the search class for the search form. I changed the css to input.search 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.


  4. jvincilione
    Posted 3 years ago #

    Thanks for you help. All is good now!

Topic Closed

This topic has been closed to new replies.

About this Topic