Support » How-To and Troubleshooting » Searching kicks me to the blog page

Searching kicks me to the blog page

  • Hey,

    Just needing some help regarding setting up the search function. I’m building off of the Clean Home theme (because it was pretty bare bones). It doesn’t come with a default searchform so I tried adding one. No matter how I set it up it either displays a blank page (with correct header and footer) or it simply kicks me out to the default blog page.

    Even if i list tags, which are clickable, they also kick me to the blog page.

    Any ideas?


Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi


    Forum Moderator

    What’s in your searchform.php file?

    Sorry here’s the code, it pretty standard stuff. I’ll redo the results page once it starts listing the correct things.


    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
    	<label class="hidden" for="s"><?php _e('Search:'); ?></label>
    	<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    	<input type="submit" id="searchsubmit" value="GO" />

    And the search results page just taken from the twentyten theme:

     * The template for displaying Search Results pages.
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
    get_header(); ?>
    		<div id="container">
    			<div id="content" role="main">
    <?php if ( have_posts() ) : ?>
    				<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'cleanhome' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
    				/* 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', 'cleanhome' ); ?></h2>
    					<div class="entry-content">
    						<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'cleanhome' ); ?></p>
    						<?php get_search_form(); ?>
    					</div><!-- .entry-content -->
    				</div><!-- #post-0 -->
    <?php endif; ?>
    			</div><!-- #content -->
    		</div><!-- #container -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>


    Forum Moderator

    searchform.php looks OK – although you should really be using <?php echo esc_url( home_url( '/' ) ); ?> rather than <?php bloginfo('url'); ?>/. what happens if you remove the file?

    Hey I’ll just give you the staging url…


    replace the dots… just don’t want search engines picking it up.

    So right now the search form in the sidebar either gives you a blank page or brings you to the blog page. Still under construction so lots of links are pretty bare.

    If i take out the searchform.php then it always brings me to the blog.

    Oh crap… url is wrong:




    Forum Moderator

    If i take out the searchform.php then it always brings me to the blog.

    And you are definitely searching for text that you know is there? I usually test using a common word such as “and” if I have “real” post content to play with.

    Yep. If you do a search from th homepage right now for and it’ll display the search results page… with Nothing found message.

    If however I search for Lemon… which is an ingredient and in many of the posts and titles… then I get a different page… but it’s not displaying the actual posts. So I guess it’s half working.

    Thanks for all the help so far BTW!

    hmmm. I just changed the theme to a really barebones theme, and search is working now. Must be an issue with the clean home theme.



    Forum Moderator

    That’s great thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Searching kicks me to the blog page’ is closed to new replies.