Support » Fixing WordPress » Site goes haywire after Search

  • Hi,
    I just started using WordPress and I must say it really is great, I switched from another CMS so I do have some experience with PHP but nothing with WordPress.

    I have been stuck on this little problem for a while, I just can’t understand where the problem is originated from. My website is http://www.tillemont.com/new/wordpress/ but if you search anything on the site, the search result page is all screwed up, the tables and css is off. here is an example http://tillemont.com/new/wordpress/?s=marions-nous&lang=en

    Can anybody guide to let me know at least where I have to look into the problem

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The problem lies with your search.php template. I would open both index.php and search.php side by side and see what the differences are. There’s probably a div missing somewhere.

    Thread Starter grudz

    (@grudz)

    I see in the search.php 4 opening divs and 4 closing divs, is there something i am missing?

    <?php global $theme; get_header(); ?>
        <div id="main">
    
            <?php $theme->hook('main_before'); ?>
    
            <div id="content">
    
                <?php $theme->hook('content_before'); ?>
    
                <h2 class="page-title"><?php _e( 'Search Results for:', 'themater' ); ?> <span><?php echo get_search_query(); ?></span></h2
    
                <?php
                    if (have_posts()) : while (have_posts()) : the_post(); 
    
                         /**
                         * The default post formatting from the post.php template file will be used.
                         * If you want to customize the post formatting for your search pages:
                         *
                         *   - Create a new file: post-search.php
                         *   - Copy/Paste the content of post.php to post-search.php
                         *   - Edit and customize the post-search.php file for your needs.
                         *
                         * Learn more about the get_template_part() function: http://codex.wordpress.org/Function_Reference/get_template_part
                         */
    
                        get_template_part('post', 'search');
                    endwhile;
    
                    else : ?>
                        <div class="entry">
                            <p><?php printf( __( 'Sorry, but nothing matched your search criteria: %s. Please try again with some different keywords.', 'themater' ), '<strong>' . get_search_query() . '</strong>' ); ?></p>
                        </div>
    
                        <div id="content-search">
                            <?php get_search_form(); ?>
                        </div>
                    <?php endif;
                    get_template_part('navigation');
                ?>
    
            </div><!-- #content -->
    
            <?php get_sidebars(); ?>
    
            <?php $theme->hook('main_after'); ?>
    
        </div><!-- #main -->
    
    <?php get_footer(); ?>
    Thread Starter grudz

    (@grudz)

    my </h2 wasn’t closed!

    wow, unbelievable

    thank you Christine

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Site goes haywire after Search’ is closed to new replies.