• Hi,

    I’m trying to get my “search” functionality to show an excerpt. Right now the only search result I’m getting is just the page title of the relevant page.

    I keep reading about the_excerpt, but it’s not in the default search.php file, and I don’t know where to get it or how to implement it.

    If anybody could help out with this I would be very happy.

    Thanks,
    Laura S.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You need a plugin to get an excerpt for search results; it’s not native WP. Try Search Excerpt WordPress Plugin. I use it on several sites with 2.8.5.

    Thread Starter lauras2009

    (@lauras2009)

    No … I had the plugin … but for some reason, the_excerpt() wasn’t in my native code anywhere. (At least I couldn’t find it.) I added it, and voila, it started working.

    Laura

    Search pages act like any other page, they have a loop and can use the excerpt, content or whatever other normal functions you’d have in a loop.

    Search as standard searches both the post_content and post_title, that’s unchangable without a few modifications.

    As with any other page, it can set to show for a particular category, post type, date range, month, week, meta key, etc.. in the same way you would anywhere else you use query_posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘no search excerpt’ is closed to new replies.