• The WordPress search engine in my theme is quite dreadful. It will only search within a category, so most of the time, it produces no results unless I happen to search a word that appears in that category.

    I have tried Relevanssi and Search Everything, but these are not overriding the stock search engine. Can someone help me? Here is the code from the search.php:

    <?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(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The WordPress search engine in my theme is quite dreadful. It will only search within a category

    Actually the search is just fine – that is unless a theme’s search.php, or a plugin, or someone’s own code is done wrong. Then, all bets are off.

    Thread Starter mmallett

    (@mmallett)

    Right. Are you able to tell from the code above if that is the case? For some reason, I can only search within a category, not the entire blog.

    Thread Starter mmallett

    (@mmallett)

    I just tried Swiftype as well. There is something in my coding that is preventing any plugin from overriding the WordPress search engine…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can't override Search engine’ is closed to new replies.