• Hi there,

    If I search from “All Posts” category, the search engine indeed searches all posts. But if I click on a particular blog, the search engine will only search a term within that particular post.

    How do I get the search engine, no matter what post I am in, to always search the entire blog? Here is my Search php code:

    <?php get_header(); ?>
    
    	<div id="content">
    	<?php if (have_posts()) : ?>
    
    		<h2 class="pagetitle">Search Results</h2>
    
    		<div class="navigation">
    			<div class="alignleft"><?php posts_nav_link('','','? Previous Entries') ?></div>
    			<div class="alignright"><?php posts_nav_link('','Next Entries ?','') ?></div>
    		</div>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post">
    				<h3 id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    				<small><?php the_time('l, F jS, Y') ?></small>
    
    				<div class="entry">
    					<?php the_excerpt() ?>
    				</div>
    
    				<p class="postmetadata">Posted in <?php the_category(', ') ?> <?php edit_post_link('Edit','','<strong>|</strong>'); ?>  <?php comments_popup_link('Comments are Closed ?', 'Comments are Closed ?', '% Comments are Closed ?'); ?></p> 
    
    				<!--
    				<?php trackback_rdf(); ?>
    				-->
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php posts_nav_link('','','? Previous Entries') ?></div>
    			<div class="alignright"><?php posts_nav_link('','Next Entries ?','') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2>Sorry,</h2>
    		<p> but your search did not turn up any results.</p>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    [Please use the code buttons when posting code – as is, your code may have been corrupted]

  • The topic ‘Can you help me expand my search?’ is closed to new replies.