Support » Fixing WordPress » Search Results, weird search.php

  • Hello all,

    My need is this. I want my search results page to show excerpts instead of full text. I have read all of the support forums and I know about the “the_excerpt” command, etc, but this does not apply to my page. I need some help to get my search results page to show the title of the post and excerpts only. I am going to paste the code of my page below. Any help would be greatly appreciated.

    Here comes the code:

    <?php /* Don’t remove this line. */ require(‘./wp-blog-header.php’); ?>
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
    <html xmlns=””>
    <head profile=”″>
    <title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
    <meta http-equiv=”Content-Type” content=”text/html; charset=<?php bloginfo(‘charset’); ?>” />
    <!– leave this for stats –>
    <style type=”text/css” media=”screen”>
    @import url( <?php bloginfo(‘stylesheet_url’); ?> );
    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
    <link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” />
    <link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘atom_url’); ?>” />
    <link rel=”shortcut icon” href=”/favicon/bullet.ico” />
    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
    <?php //comments_popup_script(); // off by default ?>
    <?php wp_head(); ?>
    <div id=”rap”>
    <?php get_header() ?>
    <div id=”main”>
    <div id=”content”>
    <?php if ($posts) { ?>
    <?php $post = $posts[0]; /* Hack. Set $post so that the_date() works. */ ?>
    <h3>Here are the results for your search.</h3>
    <div class=”post-info”>Did you find what you wanted ?</div>
    <?php foreach ($posts as $post) : start_wp(); ?>
    <?php require(‘post.php’); ?>
    <?php endforeach; ?>
    <div class=”navigation”>
    <div class=”alignleft”><?php posts_nav_link(”,”,’« Older Entries’) ?></div>
    <div class=”alignright”><?php posts_nav_link(”,’Newer Entries »’,”) ?></div>
    <?php } else { ?>
    <h2 class=”center”>Not Found</h2>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    <?php } ?>
    <div id=”sidebar”>
    <h2>Currently Browsing</h2>

    • <p>Here are the result of your search. If you are unable to find anything in these search results, try refining your search.</p>

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thank in advance!

  • The topic ‘Search Results, weird search.php’ is closed to new replies.