Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

www.milknhny.co.uk/ClearWatch

Im using a basis of the Twenty Twelve theme and im using the below script (yes i know that the wrappers are not correct as yet)

However its defaulting back to the main page... any ideas?

<?php
/**
* The template for displaying Search Results pages.
*
*/

get_header(); ?>

<section id="primary" class="site-content">
    <div id="content" role="main">

    <?php if ( have_posts() ) : ?>

        <header class="page-header">
            <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'Clearwatch' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
        </header>



        <?php /* Start the Loop */ ?>
        <?php while ( have_posts() ) : the_post(); ?>
            <?php get_template_part( 'content', get_post_format() ); ?>
        <?php endwhile; ?>



    <?php else : ?>

        <article id="post-0" class="post no-results not-found">
            <header class="entry-header">
                <h1 class="entry-title"><?php _e( 'Nothing Found', 'Clearwatch' ); ?></h1>
            </header>

            <div class="entry-content">
                <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'Clearwatch' ); ?></p>
                <?php get_search_form(); ?>
            </div><!-- .entry-content -->
        </article><!-- #post-0 -->

    <?php endif; ?>

    </div><!-- #content -->
</section><!-- #primary -->

Well guys i double checked my search form and it had index.php in below:

so i changed it to my search.php path and it appears to be searching but defaulting back to my own website theme? Any ideas

  <form id="searchform" method="get" action="<?php bloginfo('template_url'); ?>/Clearwatch/search.php">
share|improve this question
    
Is the file called "search.php"? –  Jake Apr 2 '13 at 12:31
    
hi Jake, yes it is –  Kirsty Harris Apr 2 '13 at 12:33
add comment

1 Answer

Ive actually solved this. It appears that there were some errors in the search.php file which resulted in lots of issues.

Thanks for your comments.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.