• I’ve managed to get everything else working nicely but for some reason the search really confuses me.

    I have this form on my pages:

    <form action="<?php bloginfo('charset'); ?>" id="searchform" method="get" role="search">
    								<input type="text" class="search bar" id="s" name="s" size="18"/>
    								<input type="image" id="searchsubmit" class="search_button" src="<?php bloginfo('url') ?>/wp-content/themes/subverb/images/search-btn.png" />
    
    							</form>

    But i really don’t get where to go from there.

    The twentyten theme has search.php and I tried copying the bits from there into my own search.php, but I get a 404 error and the search url is (for some reason), when searching for ‘test’

    my url/UTF-8?s=test&x=0&y=0

    I know i’m being massively stupid here, but for some reason I can’t get it and I just don’t get what the codex is telling me to do. It seems to be telling me how to create a page specifically for searching, rather than how to display the search results.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter minklet

    (@minklet)

    ive just noticed, i put ‘charset’ instead of url in the bloginfo tag

    Which makes me a complete moron. Sorry everyone, moron passing through.

    Anonymous User

    (@anonymized-3085)

    standard search form:

    $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
    	<div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
    	<input type="text" value="' . get_search_query() . '" name="s" id="s" />
    	<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
    	</div>
    	</form>';

    I think you have a mistake or 2 in your coding…

    Thread Starter minklet

    (@minklet)

    I’ve got it working now, I was just being a tit.

    Only problem I now have is that when I click ‘next page’ on my search results it gives me a strange url

    Can anyone have a look for me? Search ‘test’

    http://subverb.net/blog/moog/

    This is what I have as my search.php loop

    <div class="post_section grid_15">
    
    <?php global $wp_query;
    $p = array('post_type' => array('event','post'));
    $post = array_merge($wp_query->query_vars, $p);
    query_posts($post); ?>
    <?php if (have_posts()) : ?>
    <h2>Search Results</h2>
    <br /><br />
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    						<div class="post_header">
    
    			<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
    			<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Posted on <?php the_time('F jS, Y') ?> by <?php the_author() ?></p>
    			</div><!--End of Post Header-->
    				<div class="post_footer"><p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p></div><!--End of Post Footer-->
    			</div>
    
    		<?php endwhile; ?>
    
    		<?php if (next_posts_link() || previous_posts_link()): ?>
    			<?php next_posts_link('&laquo; Older Entries') ?> | <?php previous_posts_link('Newer Entries &raquo;') ?>
    		<?php endif ?>
    <?php else : ?>
    
    	<h2>Not Found</h2>
    	<p>Sorry, but you are looking for something that isn't here.</p>
    	<?php get_search_form(); ?>
    
    <?php endif; ?>
    
    </div>

    Anonymous User

    (@anonymized-3085)

    somehow you are adding in /blog/moog where it isn’t needed, this may be from your search form, as navigating to page 2 and back to the first page fixes it.

    Thread Starter minklet

    (@minklet)

    What do I correct on my search form? Its what I have above except the action is bloginfo(‘url’)

    Anonymous User

    (@anonymized-3085)

    add a slash at the end…

    Thread Starter minklet

    (@minklet)

    Ah, thanks. Works great now

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Search help (probably simple)’ is closed to new replies.