Jump to content
Sign in to follow this  
mguilfoyle

Search not working

Recommended Posts

mguilfoyle

I've recently installed and customized a platformpro theme. It's working pretty well, except for the search functionality. My index page has a search form (which looks to be rendering properly) but searching does nothing but refresh the page. I've tried adding a custom search page based off the 'twentyten' theme. After doing this, searching does redirect me to another page but the search results are always empty. I'd like to get this search function working, but I'm unsure what to do next. Any Advice?

Share this post


Link to post
Share on other sites
cshoffmann

Can you please provide a site url link?

Share this post


Link to post
Share on other sites
cmunns

Does your custom search actually have a loop in it? What code did you use?

Share this post


Link to post
Share on other sites
mguilfoyle

Sorry if the formatting gets pretty mangled here. I have this in my search.php's content area:

	<?php if ( have_posts() ) : ?>
					<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'platformpro' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
					<?php
					/* Run the loop for the search to output the results.
					 * If you want to overload this in a child theme then include a file
					 * called loop-search.php and that will be used instead.
					 */
					 get_template_part( 'loop', 'search' );
					?>
	<?php else : ?>
					<div id="post-0" class="post no-results not-found">
						<h2 class="entry-title"><?php _e( 'Nothing Found', 'platformpro' ); ?></h2>
						<div class="entry-content">
							<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'platformpro' ); ?></p>
							<?php get_search_form(); ?>
						</div><!-- .entry-content -->
					</div><!-- #post-0 -->
	<?php endif; ?>
	

Share this post


Link to post
Share on other sites
mguilfoyle

I assume it has something to do with the following line in the loop:

get_template_part( 'loop', 'search' );

Is there a specific way I should be doing this with platformpro?

Share this post


Link to post
Share on other sites
cmunns

I suppose that's fine but what is inside the search file that you are calling with the get_template_part function?

Share this post


Link to post
Share on other sites
mguilfoyle

Ah, it had nothing. I've created a new loop-search.php and it appears to be working now. Thanks for the help. Side note, is a search results template included with pagelines? Or does this need to be created from scratch each time?

Share this post


Link to post
Share on other sites
cmunns

It's included in the template files via conditionals so there isn't an actual search.php per se

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×