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.

I've looked around and can't figure out what happened to my search page. It used to work but then I guess why I added my archives.php and a bunch of other things it stopped working, but I can't tell at what point in the last week it stopped working.I usually test almost everything on the site when I make changes but for some reason I didn't check the search function until near the end and then it was too late. This is the site.

        <div id="main">
        <?php if ( have_posts() ) : ?>

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



            <?php /* Start the Loop */ ?>
            <?php while ( have_posts() ) : the_post(); ?>

                <?php get_template_part( 'loop', 'search' ); ?>

            <?php endwhile; ?>

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

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

        <?php endif; ?>

        </div><!-- #main -->

And of course I have my php opening and closing tags, header & footer. I just didn't want to add everything.

Currently, if you search for a word that you know is somewhere in the site it returns a NOTHING FOUND. I believe it's to do with my get_template_part as I don't quite understand the wordpress codex for it.

<?php get_template_part( 'loop', 'search' ); ?>

If I use

<?php get_template_part( 'content', 'search' ); ?>

It returns with an error

enter image description here

Which I have no clue what it means.

What could be making the search function behave like this? It used to work. Any help is appreciated!

UPDATE

<?php
/**
 * @package Toolbox
 */
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
        <h1 class="title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'toolbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    <?php if ( 'post' == get_post_type() ) : ?>
        <div class="entry-meta">Posted on: <?php the_time('F j, Y'); ?> </div><!-- .entry-meta -->
        <?php endif; ?>
    </header><!-- .entry-header -->
share|improve this question
    
Can you paste the first 5 lines of the file "content.php" in your toolbox theme? –  jessica Jun 18 '12 at 17:48
    
Yep. See updated question. –  kia4567 Jun 18 '12 at 17:54
1  
You didn't close your php tag after your comment. Add a ?> on line 5 before your <article> –  Alex Lane Jun 18 '12 at 18:35
    
Thanks. I'll be sure to watch for simple mistakes like that. –  kia4567 Jun 18 '12 at 20:56
add comment

1 Answer 1

up vote 0 down vote accepted

You are missing the closing ?> php tag before the <article> tag.

share|improve this answer
    
Wow. Easy fix. Thanks. –  kia4567 Jun 18 '12 at 20:56
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.