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
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!
<?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 -->