• Hello, how can I get search-reloaded to only search in the titles of the posts and not the postcontent?

    Any help will be very appreciated ??

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is the loop I use in my search.php file (I believe it was taken from the basic Kubrick theme and altered):

    <?php while (have_posts()) : the_post(); ?>

    <div class="post">
    <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>

    <p class="postmetadata">Posted in <?php the_category(', ') ?> <small><?php edit_post_link('Edit', ''); ?></small></p>
    </div>

    <?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    </div>

    <?php else : ?>

    <p class="alert"><strong>Sorry, but your search for <em>'<?php echo wp_specialchars($s); ?>'</em> brought no results. You can check the lists below or try a different search.</strong></p>

    <?php endif; ?>

    This is the part of it that returns the title:

    <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>

    download and edit the search reloaded plugin. edit the sql query to match against (post_title) rather than (post_title, post_content).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search limited to titles only’ is closed to new replies.